From a42c3147cce7292b9f000bfdc81232f44f143d24 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Fri, 15 Feb 2008 01:24:49 +0000 Subject: [PATCH] Fix PR2028 llvm-svn: 47150 --- llvm/lib/Transforms/Scalar/LoopRotation.cpp | 4 ++-- llvm/test/Other/2008-02-14-PassManager.ll | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 llvm/test/Other/2008-02-14-PassManager.ll diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp index 8581f9ead744..153f09563dfc 100644 --- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -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(); AU.addPreserved(); - AU.addRequiredID(LoopSimplifyID); - AU.addPreservedID(LoopSimplifyID); AU.addPreserved(); AU.addPreserved(); } diff --git a/llvm/test/Other/2008-02-14-PassManager.ll b/llvm/test/Other/2008-02-14-PassManager.ll new file mode 100644 index 000000000000..985e1908ef08 --- /dev/null +++ b/llvm/test/Other/2008-02-14-PassManager.ll @@ -0,0 +1,5 @@ +; RUN: llvm-as < %s | opt -loop-unroll -loop-rotate -simplifycfg -disable-output +; PR 2028 +define i32 @test1() { + ret i32 0; +}