[PATCH] D51396: [Constant Hoisting] Hoisting Constant GEP Expressions

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 29 15:48:16 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/ConstantHoisting.cpp:407
+  int Cost = 3;;
+  if (Cost > TTI->getIntImmCost(Instruction::Add, 1, Offset, PtrIntTy)) {
+    ConstCandVecType &ExprCandVec = ConstGEPCandMap[BaseGV];
----------------
This still seems weird; we only hoist if the cost is less than 3?


Repository:
  rL LLVM

https://reviews.llvm.org/D51396





More information about the llvm-commits mailing list