[MC] Use .p2align instead of .align
For historic reasons, the behavior of .align differs between targets.
Fortunately, there are alternatives, .p2align and .balign, which make the
interpretation of the parameter explicit, and which behave consistently across
targets.
This patch teaches MC to use .p2align instead of .align, so that people reading
code for multiple architectures don't have to remember which way each platform
does its .align directive.
Differential Revision: http://reviews.llvm.org/D16549
llvm-svn: 258750
diff --git a/llvm/test/CodeGen/PowerPC/2010-02-04-EmptyGlobal.ll b/llvm/test/CodeGen/PowerPC/2010-02-04-EmptyGlobal.ll
index 1ba11d3..160b26e 100644
--- a/llvm/test/CodeGen/PowerPC/2010-02-04-EmptyGlobal.ll
+++ b/llvm/test/CodeGen/PowerPC/2010-02-04-EmptyGlobal.ll
@@ -6,7 +6,7 @@
@_cmd = constant %cmd.type zeroinitializer
; CHECK: .globl __cmd
-; CHECK-NEXT: .align 3
+; CHECK-NEXT: .p2align 3
; CHECK-NEXT: __cmd:
; CHECK-NEXT: .byte 0
diff --git a/llvm/test/CodeGen/PowerPC/align.ll b/llvm/test/CodeGen/PowerPC/align.ll
index 0797ca8..52ac2c1 100644
--- a/llvm/test/CodeGen/PowerPC/align.ll
+++ b/llvm/test/CodeGen/PowerPC/align.ll
@@ -9,33 +9,33 @@
; no alignment
@c = global i16 2
-;ELF: .align 1
+;ELF: .p2align 1
;ELF: c:
-;DARWIN: .align 1
+;DARWIN: .p2align 1
;DARWIN: _c:
@d = global i32 3
-;ELF: .align 2
+;ELF: .p2align 2
;ELF: d:
-;DARWIN: .align 2
+;DARWIN: .p2align 2
;DARWIN: _d:
@e = global i64 4
-;ELF: .align 3
+;ELF: .p2align 3
;ELF: e
-;DARWIN: .align 3
+;DARWIN: .p2align 3
;DARWIN: _e:
@f = global float 5.0
-;ELF: .align 2
+;ELF: .p2align 2
;ELF: f:
-;DARWIN: .align 2
+;DARWIN: .p2align 2
;DARWIN: _f:
@g = global double 6.0
-;ELF: .align 3
+;ELF: .p2align 3
;ELF: g:
-;DARWIN: .align 3
+;DARWIN: .p2align 3
;DARWIN: _g:
@bar = common global [75 x i8] zeroinitializer, align 128
diff --git a/llvm/test/CodeGen/PowerPC/code-align.ll b/llvm/test/CodeGen/PowerPC/code-align.ll
index 19d1b23..e36f6f9 100644
--- a/llvm/test/CodeGen/PowerPC/code-align.ll
+++ b/llvm/test/CodeGen/PowerPC/code-align.ll
@@ -22,9 +22,9 @@
; GENERIC-LABEL: .globl foo
; BASIC-LABEL: .globl foo
; PWR-LABEL: .globl foo
-; GENERIC: .align 2
-; BASIC: .align 4
-; PWR: .align 4
+; GENERIC: .p2align 2
+; BASIC: .p2align 4
+; PWR: .p2align 4
; GENERIC: @foo
; BASIC: @foo
; PWR: @foo
@@ -41,9 +41,9 @@
; GENERIC: mtctr
; BASIC: mtctr
; PWR: mtctr
-; GENERIC-NOT: .align
-; BASIC: .align 4
-; PWR: .align 4
+; GENERIC-NOT: .p2align
+; BASIC: .p2align 4
+; PWR: .p2align 4
; GENERIC: lwzu
; BASIC: lwzu
; PWR: lwzu
@@ -83,9 +83,9 @@
; GENERIC: mtctr
; BASIC: mtctr
; PWR: mtctr
-; GENERIC-NOT: .align
-; BASIC: .align 4
-; PWR: .align 5
+; GENERIC-NOT: .p2align
+; BASIC: .p2align 4
+; PWR: .p2align 5
; GENERIC: bdnz
; BASIC: bdnz
; PWR: bdnz
diff --git a/llvm/test/CodeGen/PowerPC/ppc64-linux-func-size.ll b/llvm/test/CodeGen/PowerPC/ppc64-linux-func-size.ll
index fb017bc..6f8351b 100644
--- a/llvm/test/CodeGen/PowerPC/ppc64-linux-func-size.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc64-linux-func-size.ll
@@ -2,7 +2,7 @@
; CHECK: .section .opd,"aw",@progbits
; CHECK-NEXT: test1:
-; CHECK-NEXT: .align 3
+; CHECK-NEXT: .p2align 3
; CHECK-NEXT: .quad .L[[BEGIN:.*]]
; CHECK-NEXT: .quad .TOC.@tocbase
; CHECK-NEXT: .quad 0
diff --git a/llvm/test/CodeGen/PowerPC/ppc64-toc.ll b/llvm/test/CodeGen/PowerPC/ppc64-toc.ll
index 7500ed6..8d35cba 100644
--- a/llvm/test/CodeGen/PowerPC/ppc64-toc.ll
+++ b/llvm/test/CodeGen/PowerPC/ppc64-toc.ll
@@ -9,7 +9,7 @@
define i64 @access_int64(i64 %a) nounwind readonly {
entry:
; CHECK-LABEL: access_int64:
-; CHECK-NEXT: .align 3
+; CHECK-NEXT: .p2align 3
; CHECK-NEXT: .quad .L[[BEGIN:.*]]
; CHECK-NEXT: .quad .TOC.@tocbase
; CHECK-NEXT: .quad 0