2013-04-11 12:32:23 +00:00
|
|
|
; RUN: opt < %s -instcombine -S | FileCheck %s
|
2007-03-23 21:57:47 +00:00
|
|
|
|
|
|
|
define i41 @test0(i41 %A, i41 %B, i41 %C) {
|
|
|
|
%X = shl i41 %A, %C
|
|
|
|
%Y = shl i41 %B, %C
|
|
|
|
%Z = and i41 %X, %Y
|
|
|
|
ret i41 %Z
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test0(
|
2013-04-11 12:32:23 +00:00
|
|
|
; CHECK-NEXT: and i41 %A, %B
|
|
|
|
; CHECK-NEXT: shl i41
|
|
|
|
; CHECK-NEXT: ret
|
2007-03-23 21:57:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define i57 @test1(i57 %A, i57 %B, i57 %C) {
|
|
|
|
%X = lshr i57 %A, %C
|
|
|
|
%Y = lshr i57 %B, %C
|
|
|
|
%Z = or i57 %X, %Y
|
|
|
|
ret i57 %Z
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test1(
|
2013-04-11 12:32:23 +00:00
|
|
|
; CHECK-NEXT: or i57 %A, %B
|
|
|
|
; CHECK-NEXT: lshr i57
|
|
|
|
; CHECK-NEXT: ret
|
2007-03-23 21:57:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
define i49 @test2(i49 %A, i49 %B, i49 %C) {
|
|
|
|
%X = ashr i49 %A, %C
|
|
|
|
%Y = ashr i49 %B, %C
|
|
|
|
%Z = xor i49 %X, %Y
|
|
|
|
ret i49 %Z
|
2013-07-14 01:42:54 +00:00
|
|
|
; CHECK-LABEL: @test2(
|
2013-04-11 12:32:23 +00:00
|
|
|
; CHECK-NEXT: xor i49 %A, %B
|
|
|
|
; CHECK-NEXT: ashr i49
|
|
|
|
; CHECK-NEXT: ret
|
2007-03-23 21:57:47 +00:00
|
|
|
}
|