[PATCH] D105309: [InstCombine] Don't combine PHI before catchswitch

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 2 00:41:25 PDT 2021


lebedev.ri accepted this revision.
lebedev.ri added a comment.
This revision is now accepted and ready to land.

LG with nits



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:1320
   // If the incoming values are pointer casts of the same original value,
   // replace the phi with a single cast.
   if (PN.getType()->isPointerTy()) {
----------------



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp:1321
   // replace the phi with a single cast.
   if (PN.getType()->isPointerTy()) {
     Value *IV0 = PN.getIncomingValue(0);
----------------
The fix should go here - what's the point of doing all that computation if we know by now that we are going to throw it away?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D105309



More information about the llvm-commits mailing list