mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
Fix crasher introduced in r200203 and caught by a libc++ buildbot. Don't assume that getMulExpr returns a SCEVMulExpr, it may have simplified it to something else!
llvm-svn: 200210
This commit is contained in:
parent
baf1d18cf0
commit
30a25a7139
@ -2292,7 +2292,9 @@ const SCEV *ScalarEvolution::getUDivExactExpr(const SCEV *LHS,
|
||||
Operands.append(Mul->op_begin() + 1, Mul->op_end());
|
||||
LHS = getMulExpr(Operands);
|
||||
RHS = RHSCst;
|
||||
Mul = cast<SCEVMulExpr>(LHS);
|
||||
Mul = dyn_cast<SCEVMulExpr>(LHS);
|
||||
if (!Mul)
|
||||
return getUDivExactExpr(LHS, RHS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -77,3 +77,12 @@ define void @test5(i32 %i) {
|
||||
; CHECK: --> (-2147483648 * (%i /u -2147483648))
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @test6(i8 %x) {
|
||||
; CHECK-LABEL: @test6
|
||||
%A = zext i8 %x to i16
|
||||
%B = shl nuw i16 %A, 8
|
||||
%C = and i16 %B, -2048
|
||||
; CHECK: --> (2048 * ((zext i8 %x to i16) /u 8))
|
||||
ret void
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user