[PATCH] D110246: [InstSimplify][InstCombine] Fold ptrtoint(gep i8 null, x) -> x

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 23 08:20:36 PDT 2021


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:4682-4686
+        for (unsigned i = 1, e = GEP->getNumOperands() - 1; i < e; ++i) {
+          if (!match(GEP->getOperand(i), m_ZeroInt()))
+            OnlyLastIndexNonzero = false;
+        }
+        Value *LastIndexOp = GEP->getOperand(GEP->getNumOperands() - 1);
----------------
Can this be something closer to this?
I'm having trouble parsing the current one..


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D110246/new/

https://reviews.llvm.org/D110246



More information about the llvm-commits mailing list