1 ; RUN: opt < %s -instsimplify -S | not grep or
3 ; Test the case where integer BitWidth <= 64 && BitWidth % 2 != 0.
4 define i39 @test1(i39 %V, i39 %M) {
5 ;; If we have: ((V + N) & C1) | (V & C2)
6 ;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
8 %C1 = xor i39 274877906943, -1 ;; C2 = 274877906943
9 %N = and i39 %M, 274877906944
12 %D = and i39 %V, 274877906943
16 ; CHECK-NEXT: and {{.*}}, -274877906944
21 ; Test the case where Integer BitWidth > 64 && BitWidth <= 1024.
22 define i399 @test2(i399 %V, i399 %M) {
23 ;; If we have: ((V + N) & C1) | (V & C2)
24 ;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
26 %C1 = xor i399 274877906943, -1 ;; C2 = 274877906943
27 %N = and i399 %M, 18446742974197923840
30 %D = and i399 %V, 274877906943
34 ; CHECK-NEXT: and {{.*}}, 18446742974197923840