summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/fast-isel-args.ll
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2013-02-25 21:59:35 +0000
committerChad Rosier <mcrosier@apple.com>2013-02-25 21:59:35 +0000
commita92ef4ba5b6f19a9e730ad518e70bc5298c03648 (patch)
tree9b63584165bea5bdf2e80c27d44d74ad938f1dac /llvm/test/CodeGen/X86/fast-isel-args.ll
parent006c1d1d49bdc714d9aa4ea167cba18f6fe7a28e (diff)
downloadbcm5719-llvm-a92ef4ba5b6f19a9e730ad518e70bc5298c03648.tar.gz
bcm5719-llvm-a92ef4ba5b6f19a9e730ad518e70bc5298c03648.zip
[fast-isel] Add X86FastIsel::FastLowerArguments to handle functions with 6 or
fewer scalar integer (i32 or i64) arguments. It completely eliminates the need for SDISel for trivial functions. Also, add the new llc -fast-isel-abort-args option, which is similar to -fast-isel-abort option, but for formal argument lowering. llvm-svn: 176052
Diffstat (limited to 'llvm/test/CodeGen/X86/fast-isel-args.ll')
-rw-r--r--llvm/test/CodeGen/X86/fast-isel-args.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/fast-isel-args.ll b/llvm/test/CodeGen/X86/fast-isel-args.ll
new file mode 100644
index 00000000000..ab42f6448d4
--- /dev/null
+++ b/llvm/test/CodeGen/X86/fast-isel-args.ll
@@ -0,0 +1,25 @@
+; RUN: llc < %s -fast-isel -fast-isel-abort -fast-isel-abort-args -verify-machineinstrs -mtriple=x86_64-apple-darwin10
+
+; Just make sure these don't abort when lowering the arguments.
+define i32 @t1(i32 %a, i32 %b, i32 %c) {
+entry:
+ %add = add nsw i32 %b, %a
+ %add1 = add nsw i32 %add, %c
+ ret i32 %add1
+}
+
+define i64 @t2(i64 %a, i64 %b, i64 %c) {
+entry:
+ %add = add nsw i64 %b, %a
+ %add1 = add nsw i64 %add, %c
+ ret i64 %add1
+}
+
+define i64 @t3(i32 %a, i64 %b, i32 %c) #2 {
+entry:
+ %conv = sext i32 %a to i64
+ %add = add nsw i64 %conv, %b
+ %conv1 = sext i32 %c to i64
+ %add2 = add nsw i64 %add, %conv1
+ ret i64 %add2
+}
OpenPOWER on IntegriCloud