[PATCH] D52294: [InstCombine] Fix incongruous GEP type addrspace

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 4 14:15:05 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D52294#1255824, @spatel wrote:

> LGTM, but let's see if @lebedev.ri has any other feedback before marking as approved.


No, no real feedback, that is why i'm not commenting.



================
Comment at: lib/IR/Verifier.cpp:3142
+
+  if (PointerType *PTy = dyn_cast<PointerType>(GEP.getType())) {
+    Assert(GEP.getAddressSpace() == PTy->getAddressSpace(),
----------------
`if (auto *PTy = dyn_cast<PointerType>(GEP.getType())) {`


================
Comment at: lib/Transforms/InstCombine/InstructionCombining.cpp:2055
           areMatchingArrayAndVecTypes(SrcEltType, GEPEltType)))) {
-      GEP.setOperand(0, SrcOp);
-      GEP.setSourceElementType(SrcEltType);
-      return &GEP;
+
+      Value *NGEP =
----------------
nit: Maybe add a comment explaining why we are creating a new GEP + AddrSpaceCast?


Repository:
  rL LLVM

https://reviews.llvm.org/D52294





More information about the llvm-commits mailing list