[PATCH] D50931: Consider isLegalAddressingImm in Constant Hoisting

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 18:41:42 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/ConstantHoisting.cpp:596
+          // Make sure the constant is used as pointer operand of the StoreInst.
+          if (SI->getPointerOperand() == CC->ConstInt) {
+            MemUseValTy = SI->getValueOperand()->getType();
----------------
Looking again, this doesn't work.  ConstInt is a ConstantInt, SI->getPointerOperand() is a pointer.

ConstantUser has a member OpndIdx which might be helpful here.  And more test coverage for stores would be nice.


Repository:
  rL LLVM

https://reviews.llvm.org/D50931





More information about the llvm-commits mailing list