[llvm-commits] [llvm] r77705 - in /llvm/trunk: lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp test/CodeGen/Thumb2/thumb2-tbb.ll
Evan Cheng
evan.cheng at apple.com
Fri Jul 31 11:35:57 PDT 2009
Author: evancheng
Date: Fri Jul 31 13:35:56 2009
New Revision: 77705
URL: http://llvm.org/viewvc/llvm-project?rev=77705&view=rev
Log:
Until we have a "ALIGN" pseudo instruction, have asm printer emitted a .align
to ensure the instruction that follows a TBB (when the number of table entries
is odd) is 2-byte aligned.
Patch by Sandeep Patel.
Modified:
llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
llvm/trunk/test/CodeGen/Thumb2/thumb2-tbb.ll
Modified: llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp?rev=77705&r1=77704&r2=77705&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp Fri Jul 31 13:35:56 2009
@@ -988,6 +988,13 @@
if (i != e-1)
O << '\n';
}
+
+ // Make sure the instruction that follows TBB is 2-byte aligned.
+ // FIXME: Constant island pass should insert an "ALIGN" instruction instead.
+ if (ByteOffset && (JTBBs.size() & 1)) {
+ O << '\n';
+ EmitAlignment(1);
+ }
}
void ARMAsmPrinter::printTBAddrMode(const MachineInstr *MI, int OpNum) {
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-tbb.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-tbb.ll?rev=77705&r1=77704&r2=77705&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-tbb.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-tbb.ll Fri Jul 31 13:35:56 2009
@@ -5,6 +5,7 @@
entry:
; CHECK: bar:
; CHECK: tbb
+; CHECK: .align 1
switch i32 %n.u, label %bb12 [i32 1, label %bb i32 2, label %bb6 i32 4, label %bb7 i32 5, label %bb8 i32 6, label %bb10 i32 7, label %bb1 i32 8, label %bb3 i32 9, label %bb4 i32 10, label %bb9 i32 11, label %bb2 i32 12, label %bb5 i32 13, label %bb11 ]
bb:
More information about the llvm-commits
mailing list