mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
InstSimplify: shl nsw/nuw undef, %V -> undef
We can always choose an value for undef which might cause %V to shift out an important bit except for one case, when %V is zero. However, shl behaves like an identity function when the right hand side is zero. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -216,3 +216,31 @@ define i32 @test27() {
|
||||
%b = shl i32 0, undef
|
||||
ret i32 %b
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @test28
|
||||
; CHECK: ret i32 undef
|
||||
define i32 @test28(i32 %a) {
|
||||
%b = shl nsw i32 undef, %a
|
||||
ret i32 %b
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @test29
|
||||
; CHECK: ret i32 undef
|
||||
define i32 @test29(i32 %a) {
|
||||
%b = shl nuw i32 undef, %a
|
||||
ret i32 %b
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @test30
|
||||
; CHECK: ret i32 undef
|
||||
define i32 @test30(i32 %a) {
|
||||
%b = shl nsw nuw i32 undef, %a
|
||||
ret i32 %b
|
||||
}
|
||||
|
||||
; CHECK-LABEL: @test31
|
||||
; CHECK: ret i32 0
|
||||
define i32 @test31(i32 %a) {
|
||||
%b = shl i32 undef, %a
|
||||
ret i32 %b
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user