Fix PR2028
authorDevang Patel <dpatel@apple.com>
Fri, 15 Feb 2008 01:24:49 +0000 (01:24 +0000)
committerDevang Patel <dpatel@apple.com>
Fri, 15 Feb 2008 01:24:49 +0000 (01:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47150 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/LoopRotation.cpp
test/Other/2008-02-14-PassManager.ll [new file with mode: 0644]

index 8581f9ead7442228b8fefece6ee5659632d41a75..153f09563dfc9fad4d4ed6eb0ceac4f6d439ac7d 100644 (file)
@@ -56,12 +56,12 @@ namespace {
 
     // LCSSA form makes instruction renaming easier.
     virtual void getAnalysisUsage(AnalysisUsage &AU) const {
+      AU.addRequiredID(LoopSimplifyID);
+      AU.addPreservedID(LoopSimplifyID);
       AU.addRequiredID(LCSSAID);
       AU.addPreservedID(LCSSAID);
       AU.addPreserved<ScalarEvolution>();
       AU.addPreserved<LoopInfo>();
-      AU.addRequiredID(LoopSimplifyID);
-      AU.addPreservedID(LoopSimplifyID);
       AU.addPreserved<DominatorTree>();
       AU.addPreserved<DominanceFrontier>();
     }
diff --git a/test/Other/2008-02-14-PassManager.ll b/test/Other/2008-02-14-PassManager.ll
new file mode 100644 (file)
index 0000000..985e190
--- /dev/null
@@ -0,0 +1,5 @@
+; RUN:  llvm-as < %s |  opt -loop-unroll -loop-rotate -simplifycfg -disable-output
+; PR 2028
+define i32 @test1() {
+       ret i32 0;
+}