[all-commits] [llvm/llvm-project] d14310: [GlobalOpt] Fix a miscompile when evaluating struc...

Jon Roelofs via All-commits all-commits at lists.llvm.org
Wed Jul 14 15:45:51 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d14310306827f5c0a4feb6a9ffddddcdfb24fcca
      https://github.com/llvm/llvm-project/commit/d14310306827f5c0a4feb6a9ffddddcdfb24fcca
  Author: Jon Roelofs <jonathan_roelofs at apple.com>
  Date:   2021-07-14 (Wed, 14 Jul 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/Evaluator.cpp
    A llvm/test/Transforms/GlobalOpt/store-struct-element.ll

  Log Message:
  -----------
  [GlobalOpt] Fix a miscompile when evaluating struct initializers.

The bug was that evaluateBitcastFromPtr attempts a narrowing to a struct's 0th
element of a store that covers other elements. While this is okay on the load
side, applying it to stores causes us to miss the writes to the additionally
covered elements.

rdar://79503568

Differential revision: https://reviews.llvm.org/D105838




More information about the All-commits mailing list