diff options
author | Hans Wennborg <hans@hanshq.net> | 2015-11-19 16:35:08 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2015-11-19 16:35:08 +0000 |
commit | dcc2500452746939988c613e2b6d00513dc2ab3e (patch) | |
tree | e481c9d219e1b7274e06ecf50e083fb93a287673 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 768579c409cde8517e70867df5783402e8da8d08 (diff) | |
download | bcm5719-llvm-dcc2500452746939988c613e2b6d00513dc2ab3e.tar.gz bcm5719-llvm-dcc2500452746939988c613e2b6d00513dc2ab3e.zip |
X86: More efficient legalization of wide integer compares
In particular, this makes the code for 64-bit compares on 32-bit targets
much more efficient.
Example:
define i32 @test_slt(i64 %a, i64 %b) {
entry:
%cmp = icmp slt i64 %a, %b
br i1 %cmp, label %bb1, label %bb2
bb1:
ret i32 1
bb2:
ret i32 2
}
Before this patch:
test_slt:
movl 4(%esp), %eax
movl 8(%esp), %ecx
cmpl 12(%esp), %eax
setae %al
cmpl 16(%esp), %ecx
setge %cl
je .LBB2_2
movb %cl, %al
.LBB2_2:
testb %al, %al
jne .LBB2_4
movl $1, %eax
retl
.LBB2_4:
movl $2, %eax
retl
After this patch:
test_slt:
movl 4(%esp), %eax
movl 8(%esp), %ecx
cmpl 12(%esp), %eax
sbbl 16(%esp), %ecx
jge .LBB1_2
movl $1, %eax
retl
.LBB1_2:
movl $2, %eax
retl
Differential Revision: http://reviews.llvm.org/D14496
llvm-svn: 253572
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
0 files changed, 0 insertions, 0 deletions