[PATCH] D138637: [InstCombine] Combine opaque pointer single index GEP and with src GEP which has result of array type

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 2 08:40:10 PST 2022


jmmartinez added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstructionCombining.cpp:2091-2097
+    return IsInBounds
+               ? GetElementPtrInst::CreateInBounds(Src->getSourceElementType(),
+                                                   Src->getOperand(0),
+                                                   NewIndices, GEP.getName())
+               : GetElementPtrInst::Create(Src->getSourceElementType(),
+                                           Src->getOperand(0), NewIndices,
+                                           GEP.getName());
----------------
What do you think about doing the following ?

  Instruction *GEP = GetElementPtrInst::Create(Src->getSourceElementType(), Src->getOperand(0), NewIndices, GEP.getName());
  GEP->setIsInBounds(IsInBounds);
  return GEP;


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

https://reviews.llvm.org/D138637



More information about the llvm-commits mailing list