diff options
author | Bill Wendling <isanbard@gmail.com> | 2010-09-06 09:15:29 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2010-09-06 09:15:29 +0000 |
commit | b5502450ca614edc996eccb67a6d834e73abe92b (patch) | |
tree | cbf9d181fbbf1911aadd1a91697244c1b03e46af | |
parent | ed5d32e948f790df69e5c2dec331cf13402d0aed (diff) |
Approved by Chris:
$ svn merge -c 113146 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r113146 into '.':
U test/Transforms/LICM/crash.ll
U lib/Transforms/Scalar/LICM.cpp
Log:
fix PR8067, an over-aggressive assertion in LICM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_28@113152 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Scalar/LICM.cpp | 8 | ||||
-rw-r--r-- | test/Transforms/LICM/crash.ll | 14 |
2 files changed, 18 insertions, 4 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp index 0399329f0d..6cb4845392 100644 --- a/lib/Transforms/Scalar/LICM.cpp +++ b/lib/Transforms/Scalar/LICM.cpp @@ -696,10 +696,10 @@ void LICM::PromoteAliasSet(AliasSet &AS) { // it. if (isa<LoadInst>(Use)) assert(!cast<LoadInst>(Use)->isVolatile() && "AST broken"); - else if (isa<StoreInst>(Use)) - assert(!cast<StoreInst>(Use)->isVolatile() && - Use->getOperand(0) != ASIV && "AST broken"); - else + else if (isa<StoreInst>(Use)) { + assert(!cast<StoreInst>(Use)->isVolatile() && "AST broken"); + if (Use->getOperand(0) == ASIV) return; + } else return; // Not a load or store. if (!GuaranteedToExecute) diff --git a/test/Transforms/LICM/crash.ll b/test/Transforms/LICM/crash.ll index 325f250bd5..d0b6d78db1 100644 --- a/test/Transforms/LICM/crash.ll +++ b/test/Transforms/LICM/crash.ll @@ -25,3 +25,17 @@ for.cond.for.end10_crit_edge: ; preds = %for.cond for.end10: ; preds = %for.cond.for.end10_crit_edge, %entry ret void } + +; PR8067 +@g_8 = external global i32, align 4 + +define void @test2() noreturn nounwind ssp { +entry: + br label %for.body + +for.body: ; preds = %for.body, %entry + %tmp7 = load i32* @g_8, align 4 + store i32* @g_8, i32** undef, align 16 + store i32 undef, i32* @g_8, align 4 + br label %for.body +} |