[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 08:21:56 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())
----------------
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.


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