[PATCH] D50931: Consider isLegalAddressingImm in Constant Hoisting

Z. Zheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 24 17:16:10 PDT 2018


zzheng marked 2 inline comments as done.
zzheng added inline comments.


================
Comment at: lib/Transforms/Scalar/ConstantHoisting.cpp:594
+          break;
+        } else if (StoreInst *SI = dyn_cast<StoreInst>(UI)) {
+          MemUseValTy = SI->getValueOperand()->getType();
----------------
efriedma wrote:
> Oh, oops, should have spotted the issue here sooner.
> 
> This is checking that the use is a store instruction, but it isn't checking that the value is being used as an address.  So it'll do the wrong thing for an instruction like `store i32* inttoptr (i32 805874688 to i16*), i32** %foo`.
Nice catch.


Repository:
  rL LLVM

https://reviews.llvm.org/D50931





More information about the llvm-commits mailing list