[PATCH] D22124: [PM] Port UnreachableBlockElim to the new Pass Manager

Wei Mi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 7 17:40:11 PDT 2016


wmi added a comment.

Thanks for the review. Addressed davide's comments.


================
Comment at: lib/CodeGen/UnreachableBlockElim.cpp:44
@@ -49,1 +43,3 @@
+class UnreachableBlockElimLegacyPass : public FunctionPass {
+  bool runOnFunction(Function &F) override;
 
----------------
davide wrote:
> The body of `runOnFunction()` can probably be inlined here.
Right, fixed.

================
Comment at: lib/CodeGen/UnreachableBlockElim.cpp:102
@@ +101,3 @@
+PreservedAnalyses UnreachableBlockElimPass::run(Function &F,
+                                                FunctionAnalysisManager &AM) {
+  bool Changed = eliminateUnreachableBlock(F);
----------------
davide wrote:
> davide wrote:
> > AnalysisManager<Function> 
> Maybe AnalysisManager<Function> ?
Sean says no preference so I leave it as it is.

================
Comment at: test/CodeGen/X86/unreachableblockelim.ll:1
@@ +1,2 @@
+; RUN: opt -S < %s -unreachableblockelim | FileCheck %s
+; RUN: opt -S < %s -passes=unreachableblockelim | FileCheck %s
----------------
davide wrote:
> So this pass wasn't tested before?
It was tested but only by llc instead of opt. We cannot test the new pass using llc.  


Repository:
  rL LLVM

http://reviews.llvm.org/D22124





More information about the llvm-commits mailing list