Skip to content

Commit bd8a2ef

Browse files
committed
[X86] Add test case
1 parent a9d77fd commit bd8a2ef

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

llvm/test/CodeGen/X86/combine-setcc-trunc-add.ll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,3 +121,18 @@ entry:
121121
%1 = icmp ne i64 %0, 844424930131968
122122
ret i1 %1
123123
}
124+
125+
define i32 @test_trunc_add(i64 %x) {
126+
; X64-LABEL: test_trunc_add:
127+
; X64: # %bb.0: # %entry
128+
; X64-NEXT: movabsq $3940649673949184, %rax # imm = 0xE000000000000
129+
; X64-NEXT: addq %rdi, %rax
130+
; X64-NEXT: shrq $48, %rax
131+
; X64-NEXT: # kill: def $eax killed $eax killed $rax
132+
; X64-NEXT: retq
133+
entry:
134+
%add = add i64 %x, 3940649673949184
135+
%shr = lshr i64 %add, 48
136+
%conv = trunc i64 %shr to i32
137+
ret i32 %conv
138+
}

0 commit comments

Comments
 (0)