[PATCH] D88979: [InstCombine] combineLoadToOperationType(): don't fold int<->ptr cast into load

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 11 09:01:10 PDT 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:563
     if (auto* CI = dyn_cast<CastInst>(LI.user_back()))
-      if (CI->isNoopCast(DL))
+      if (CI->isNoopCast(DL) && LI.getType()->isPtrOrPtrVectorTy() ==
+                                    CI->getDestTy()->isPtrOrPtrVectorTy())
----------------
lebedev.ri wrote:
> nlopes wrote:
> > What about fixing isNoopCast() directly?
> > Is the impact too bad/large?
> I don't recall, actually. That is the final step, yes,
> but i think we can get most of the way there with small incremental changes.
(what i mean is, if "let's just do it" is the review feedback, then i can of course do it all at once..)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88979



More information about the cfe-commits mailing list