[PATCH] D65490: [SimplifyCFG] Mark missed Changed to true.

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 17:59:26 PDT 2019


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

lgtm



================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4181
       if (BI->isUnconditional()) {
         if (BI->getSuccessor(0) == BB) {
           new UnreachableInst(TI->getContext(), TI);
----------------
Is this check necessary?  If not, might be nice to remove it (in a separate change).


================
Comment at: lib/Transforms/Utils/SimplifyCFG.cpp:4192
           EraseTerminatorAndDCECond(BI);
+          Changed = true;
         } else if (BI->getSuccessor(1) == BB) {
----------------
You could sink down the `Changed = true;` outside the if/else.


================
Comment at: test/Transforms/SimplifyCFG/invalidate-dom.ll:16
+  store i32 %h, i32* %h.addr, align 4
+  %0 = load i32, i32* %h.addr, align 4
+  switch i32 %0, label %sw.default [
----------------
You can use `opt -metarenamer` to give names to all these instructions.  That makes the test a bit more resilient to changes.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D65490





More information about the llvm-commits mailing list