1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Revert r174152. The shift amount may overflow and in that case this transformation is illegal.

llvm-svn: 174156
This commit is contained in:
Nadav Rotem 2013-02-01 07:59:33 +00:00
parent 8e40171f27
commit 696003f5f2
2 changed files with 0 additions and 26 deletions

View File

@ -709,12 +709,6 @@ Instruction *InstCombiner::visitShl(BinaryOperator &I) {
match(I.getOperand(1), m_Constant(C2)))
return BinaryOperator::CreateShl(ConstantExpr::getShl(C1, C2), A);
// shl (c1 , add(y , c2)) -> (shl (shl(c1, c2)), y)
if (match(I.getOperand(0), m_Constant(C1)) &&
match(I.getOperand(1), m_Add(m_Value(A), m_Constant(C2)))) {
return BinaryOperator::CreateShl(ConstantExpr::getShl(C1, C2), A);
}
return 0;
}

View File

@ -745,23 +745,3 @@ define i32 @test62(i32 %x) {
; CHECK: @test62
; CHECK: ashr exact i32 %x, 3
}
; CHECK: @test63
; CHECK: shl <4 x i32> <i32 1, i32 2, i32 4, i32 8>, %B
define <4 x i32> @test63(i32 %n) {
entry:
%K = insertelement <4 x i32> undef, i32 %n, i32 0
%B = shufflevector <4 x i32> %K, <4 x i32> undef, <4 x i32> zeroinitializer
%A = add <4 x i32> %B, <i32 0, i32 1, i32 2, i32 3>
%T = shl <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %A
ret <4 x i32> %T
}
; CHECK: @test64
; CHECK: shl i32 524288, %n
define i32 @test64(i32 %n) {
entry:
%A = add i32 %n, 19
%T = shl i32 1 , %A
ret i32 %T
}