summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/Generic
diff options
context:
space:
mode:
authorBob Wilson <bob.wilson@apple.com>2012-05-30 00:17:12 +0000
committerBob Wilson <bob.wilson@apple.com>2012-05-30 00:17:12 +0000
commit33e5188c270fbd5ccce4ea4656f75c95ec68cfaf (patch)
treeeebfb851efa47d7d5f7ecd7054a2fba96afdf999 /llvm/test/CodeGen/Generic
parent45601d1742d159c261f7b255e00e72e55805b792 (diff)
downloadbcm5719-llvm-33e5188c270fbd5ccce4ea4656f75c95ec68cfaf.tar.gz
bcm5719-llvm-33e5188c270fbd5ccce4ea4656f75c95ec68cfaf.zip
Add an insertPass API to TargetPassConfig. <rdar://problem/11498613>
Besides adding the new insertPass function, this patch uses it to enhance the existing -print-machineinstrs so that the MachineInstrs after a specific pass can be printed. Patch by Bin Zeng! llvm-svn: 157655
Diffstat (limited to 'llvm/test/CodeGen/Generic')
-rw-r--r--llvm/test/CodeGen/Generic/print-machineinstrs.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/print-machineinstrs.ll b/llvm/test/CodeGen/Generic/print-machineinstrs.ll
new file mode 100644
index 00000000000..75b4cd14fff
--- /dev/null
+++ b/llvm/test/CodeGen/Generic/print-machineinstrs.ll
@@ -0,0 +1,14 @@
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs=branch-folder -o /dev/null |& FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs -o /dev/null |& FileCheck %s
+; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null |& FileCheck %s
+
+define i64 @foo(i64 %a, i64 %b) nounwind {
+; CHECK: -branch-folder -print-machineinstrs
+; CHECK: Control Flow Optimizer
+; CHECK-NEXT: MachineFunction Printer
+; CHECK: Machine code for function foo:
+ %c = add i64 %a, %b
+ %d = trunc i64 %c to i32
+ %e = zext i32 %d to i64
+ ret i64 %e
+}
OpenPOWER on IntegriCloud