fix PR8067, an over-aggressive assertion in LICM.

llvm-svn: 113146
This commit is contained in:
Chris Lattner 2010-09-06 05:11:24 +00:00
parent 1f45ad0aba
commit 6e6a535055
2 changed files with 18 additions and 4 deletions

View File

@ -681,10 +681,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)

View File

@ -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
}