[PATCH] D79145: Allow gep (select) combine with non-constant operands

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 17:18:09 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1729
+  // Allow transformation either if both sizes are constant or if either
+  // refers to alloca to help SROA.
+  if (!(isa<Constant>(True) && isa<Constant>(False)) &&
----------------
demorgan this


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:1731-1732
+  if (!(isa<Constant>(True) && isa<Constant>(False)) &&
+      !isa<AllocaInst>(GetUnderlyingObject(True, DL)) &&
+      !isa<AllocaInst>(GetUnderlyingObject(False, DL)))
+    return nullptr;
----------------
Calling GetUnderlyingObject so often seems potentially expensive


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

https://reviews.llvm.org/D79145





More information about the llvm-commits mailing list