llvm-6502/test
Evan Cheng 98819c9d1e For something like
uint32_t hi(uint64_t res)
{
        uint_32t hi = res >> 32;
        return !hi;
}

llvm IR looks like this:
define i32 @hi(i64 %res) nounwind uwtable ssp {
entry:
  %lnot = icmp ult i64 %res, 4294967296
  %lnot.ext = zext i1 %lnot to i32
  ret i32 %lnot.ext
}

The optimizer has optimize away the right shift and truncate but the resulting
constant is too large to fit in the 32-bit immediate field. The resulting x86
code is worse as a result:
        movabsq $4294967296, %rax       ## imm = 0x100000000
        cmpq    %rax, %rdi
        sbbl    %eax, %eax
        andl    $1, %eax

This patch teaches the x86 lowering code to handle ult against a large immediate
with trailing zeros. It will issue a right shift and a truncate followed by
a comparison against a shifted immediate.
        shrq    $32, %rdi
        testl   %edi, %edi
        sete    %al
        movzbl  %al, %eax

It also handles a ugt comparison against a large immediate with trailing bits
set. i.e. X >  0x0ffffffff -> (X >> 32) >= 1

rdar://11866926


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160312 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-16 19:35:43 +00:00
..
Analysis Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
Archive Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed. 2012-02-16 06:28:33 +00:00
Assembler Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
Bindings/Ocaml Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
Bitcode This is one of the first steps at moving to replace target-dependent 2012-07-13 23:25:25 +00:00
BugPoint Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed. 2012-02-16 06:28:33 +00:00
CodeGen For something like 2012-07-16 19:35:43 +00:00
DebugInfo The end of the prologue should be marked with is_stmt. 2012-07-12 23:30:25 +00:00
ExecutionEngine Add Mips to the list of target architectures for the MCJIT tests. 2012-06-21 20:23:32 +00:00
Feature Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
Instrumentation [asan] refactor instrumentation to allow merging the crash callbacks (not fully implemented yet, no functionality change except the BB order) 2012-07-16 16:15:40 +00:00
Integer Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
Linker Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
MC Doubleword Shift Left Logical Plus 32 2012-07-16 15:14:51 +00:00
Object Add relocation types for Hexagon processor; patch by Sidney Manning <sidneym@codeaurora.org> 2012-06-23 14:46:18 +00:00
Other Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
Scripts This allows hello world to be compiled for Mips 64 direct object. 2012-06-27 22:48:25 +00:00
TableGen Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
Transforms LSR Fix: check SCEV expression safety before expansion. 2012-07-13 23:33:10 +00:00
Unit
Verifier Fix the remaining TCL-style quotes found in the testsuite. This is 2012-07-02 19:09:46 +00:00
YAMLParser Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
CMakeLists.txt llvm/test/CMakeLists.txt: Add llvm-diff to deps. 2012-07-12 10:15:48 +00:00
lit.cfg llvm/test/lit.cfg: Retweak for Win32 to fix testing. 2012-07-03 03:59:34 +00:00
lit.site.cfg.in Remove 'site.exp' building from both CMake and configure+make. 2012-06-28 00:16:51 +00:00
Makefile Remove 'site.exp' building from both CMake and configure+make. 2012-06-28 00:16:51 +00:00
Makefile.tests
TestRunner.sh