diff options
author | Dan Gohman <gohman@apple.com> | 2009-08-27 00:14:12 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-08-27 00:14:12 +0000 |
commit | cbbea0ffc7b40f0d1dc5b692f80aa246bdd37a17 (patch) | |
tree | 7dde8d4644ce6b28a36f0d7c0a86e05ecf7a0af2 /test | |
parent | c42afd7946893f90aa701272316c22ae5143db89 (diff) | |
download | external_llvm-cbbea0ffc7b40f0d1dc5b692f80aa246bdd37a17.zip external_llvm-cbbea0ffc7b40f0d1dc5b692f80aa246bdd37a17.tar.gz external_llvm-cbbea0ffc7b40f0d1dc5b692f80aa246bdd37a17.tar.bz2 |
Expand i8 selects into control flow instead of 16-bit conditional
moves. This avoids the need to promote the operands (or implicitly
extend them, a partial register update condition), and can reduce
i8 register pressure. This substantially speeds up code such as
write_hex in lib/Support/raw_ostream.cpp.
subclass-coalesce.ll is too trivial and no longer tests what it was
originally intended to test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80184 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/X86/select-i8.ll | 12 | ||||
-rw-r--r-- | test/CodeGen/X86/subclass-coalesce.ll | 17 |
2 files changed, 12 insertions, 17 deletions
diff --git a/test/CodeGen/X86/select-i8.ll b/test/CodeGen/X86/select-i8.ll new file mode 100644 index 0000000..8b2444d --- /dev/null +++ b/test/CodeGen/X86/select-i8.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llc -march=x86 > %t +; RUN: not grep movz %t +; RUN: not grep cmov %t +; RUN: grep movb %t | count 2 + +; Don't try to use a 16-bit conditional move to do an 8-bit select, +; because it isn't worth it. Just use a branch instead. + +define i8 @foo(i1 inreg %c, i8 inreg %a, i8 inreg %b) { + %d = select i1 %c, i8 %a, i8 %b + ret i8 %d +} diff --git a/test/CodeGen/X86/subclass-coalesce.ll b/test/CodeGen/X86/subclass-coalesce.ll deleted file mode 100644 index 2673be7..0000000 --- a/test/CodeGen/X86/subclass-coalesce.ll +++ /dev/null @@ -1,17 +0,0 @@ -; RUN: llvm-as < %s | llc -march=x86 -stats |& grep {Number of cross class joins performed} - -@mem.6 = external global i64 ; <i64*> [#uses=1] - -define i64 @attachFunc() nounwind { -entry: - %tmp64.i = add i64 0, 72 ; <i64> [#uses=1] - %tmp68.i = load i64* @mem.6, align 8 ; <i64> [#uses=1] - %tmp70.i = icmp sgt i64 %tmp64.i, %tmp68.i ; <i1> [#uses=1] - br i1 %tmp70.i, label %bb73.i, label %bb116 - -bb73.i: ; preds = %entry - br label %bb116 - -bb116: ; preds = %bb73.i, %entry - ret i64 %tmp68.i -} |