[PATCH] D154010: [InstCombine] Canonicalize `getelementptr` patterns to `@llvm.ptrmask`

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 14:32:39 PDT 2023


nikic requested changes to this revision.
nikic added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2247
+                   Constant::getNullValue(GEP.getPointerOperand()->getType()),
+                   Index));
+    Value *Mask;
----------------
This is not legal, because it does not preserve pointer provenance. This one even fails to preserve it in a particularly catastrophic way, because the resulting pointer has nullary provenance (i.e. it is UB to perform any accesses through it).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154010



More information about the llvm-commits mailing list