summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/X86/code_placement_align_all.ll
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2013-04-12 00:48:32 +0000
committerNadav Rotem <nrotem@apple.com>2013-04-12 00:48:32 +0000
commitc3b0f50ac25b2277ae8712abc03485923c09716c (patch)
tree5299d0a1d862c399dfe4b1c796d944dca67483af /llvm/test/CodeGen/X86/code_placement_align_all.ll
parent73b75e01bfa15ab4d308d05861e39a4f93cb15e9 (diff)
downloadbcm5719-llvm-c3b0f50ac25b2277ae8712abc03485923c09716c.tar.gz
bcm5719-llvm-c3b0f50ac25b2277ae8712abc03485923c09716c.zip
Add a flag to align all basic blocks in the function.
When debugging performance regressions we often ask ourselves if the regression that we see is due to poor isel/sched/ra or due to some micro-architetural problem. When comparing two code sequences one good way to rule out front-end bottlenecks (and other the issues) is to force code alignment. This pass adds a flag that forces the alignment of all of the basic blocks in the program. llvm-svn: 179353
Diffstat (limited to 'llvm/test/CodeGen/X86/code_placement_align_all.ll')
-rw-r--r--llvm/test/CodeGen/X86/code_placement_align_all.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/code_placement_align_all.ll b/llvm/test/CodeGen/X86/code_placement_align_all.ll
new file mode 100644
index 00000000000..2a36a3a3af5
--- /dev/null
+++ b/llvm/test/CodeGen/X86/code_placement_align_all.ll
@@ -0,0 +1,22 @@
+; RUN: llc -march=x86 -align-all-blocks=16 < %s | FileCheck %s
+
+;CHECK: foo
+;CHECK: .align 16, 0x90
+;CHECK: .align 16, 0x90
+;CHECK: .align 16, 0x90
+;CHECK: ret
+define i32 @foo(i32 %t, i32 %l) nounwind readnone ssp uwtable {
+ %1 = icmp eq i32 %t, 0
+ br i1 %1, label %4, label %2
+
+; <label>:2 ; preds = %0
+ %3 = add nsw i32 %t, 2
+ ret i32 %3
+
+; <label>:4 ; preds = %0
+ %5 = icmp eq i32 %l, 0
+ %. = select i1 %5, i32 0, i32 5
+ ret i32 %.
+}
+
+
OpenPOWER on IntegriCloud