[PATCH] D84228: [CodeGen][TargetPassConfig] Add unreachable-mbb-elimination pass explicitly

Eugene Leviant via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 21 03:32:46 PDT 2020


evgeny777 created this revision.
evgeny777 added reviewers: atrick, stoklund, MaskRay, ychen.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

This allows starting from/stopping at this pass when doing partial pipeline execution


https://reviews.llvm.org/D84228

Files:
  llvm/lib/CodeGen/TargetPassConfig.cpp
  llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll


Index: llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll
===================================================================
--- llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll
+++ llvm/test/CodeGen/AArch64/partial-pipeline-execution.ll
@@ -7,6 +7,11 @@
 ; optimize the loop differently
 ; RUN: cmp %t.s %t2.s
 
+; Check that we can do the same with unreachable-mbb-elimination pass
+; RUN: llc -O3 -stop-after=unreachable-mbb-elimination %s -o %t-mbb-elim.mir
+; RUN: llc -O3 -start-after=unreachable-mbb-elimination %t-mbb-elim.mir -o %t3.s
+; RUN: cmp %t.s %t3.s
+
 ; ModuleID = 'loop.c'
 source_filename = "loop.c"
 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
Index: llvm/lib/CodeGen/TargetPassConfig.cpp
===================================================================
--- llvm/lib/CodeGen/TargetPassConfig.cpp
+++ llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -1205,6 +1205,9 @@
   // LiveVariables can be removed completely, and LiveIntervals can be directly
   // computed. (We still either need to regenerate kill flags after regalloc, or
   // preferably fix the scavenger to not depend on them).
+  // FIXME: UnreachableMachineBlockElim is a dependant pass of LiveVariables.
+  // When LiveVariables is removed this has to be removed/moved either.
+  addPass(&UnreachableMachineBlockElimID, false);
   addPass(&LiveVariablesID, false);
 
   // Edge splitting is smarter with machine loop info.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84228.279470.patch
Type: text/x-patch
Size: 1447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200721/a04fc7d4/attachment.bin>


More information about the llvm-commits mailing list