[PATCH] D82062: [SimplifyCFG] Update debug location when folding branch to common destination

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 18 12:01:30 PDT 2020


vsk added a subscriber: StephenTozer.
vsk accepted this revision.
vsk added a comment.
This revision is now accepted and ready to land.

Thanks, lgtm!



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2642
             // Quit if we can't remove this instruction.
             if (!tryCSEWithPredecessor(Curr, PB))
               return false;
----------------
Ah - In the single predecessor case, we erase instructions from the successor and replace their uses with an equivalent instruction in the predecessor. So I think this is fine, no change needed here.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:2761
         NewCond =
             Builder.CreateNot(NewCond, PBI->getCondition()->getName() + ".not");
       }
----------------
Ditto, it seems fine to keep the location of the condition on the 'not' instruction.


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

https://reviews.llvm.org/D82062





More information about the llvm-commits mailing list