[llvm] r331680 - Remove explicit setting of the CFI jumptable section name, it does not appear
Dmitry Mikulin via llvm-commits
llvm-commits at lists.llvm.org
Mon May 7 14:30:15 PDT 2018
Author: dmikulin
Date: Mon May 7 14:30:15 2018
New Revision: 331680
URL: http://llvm.org/viewvc/llvm-project?rev=331680&view=rev
Log:
Remove explicit setting of the CFI jumptable section name, it does not appear
to be needed: jump table sections are created with .cfi.jumptable suffix. With
this change each jump table is placed in a separate section, which allows the
linker to re-order them.
Differential Revision: https://reviews.llvm.org/D46537
Modified:
llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll
llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll
llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll
llvm/trunk/test/Transforms/LowerTypeTests/function-weak.ll
llvm/trunk/test/Transforms/LowerTypeTests/function.ll
llvm/trunk/test/Transforms/LowerTypeTests/section.ll
Modified: llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp Mon May 7 14:30:15 2018
@@ -1272,12 +1272,6 @@ void LowerTypeTestsModule::createJumpTab
createJumpTableEntry(AsmOS, ConstraintOS, JumpTableArch, AsmArgs,
cast<Function>(Functions[I]->getGlobal()));
- // Try to emit the jump table at the end of the text segment.
- // Jump table must come after __cfi_check in the cross-dso mode.
- // FIXME: this magic section name seems to do the trick.
- F->setSection(ObjectFormat == Triple::MachO
- ? "__TEXT,__text,regular,pure_instructions"
- : ".text.cfi");
// Align the whole table by entry size.
F->setAlignment(getJumpTableEntrySize());
// Skip prologue.
Modified: llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll Mon May 7 14:30:15 2018
@@ -25,13 +25,13 @@ define void @h2() "target-features"="-th
!0 = !{i32 0, !"typeid1"}
!1 = !{i32 0, !"typeid2"}
-; CHECK: define private void {{.*}} #[[AT:.*]] section ".text.cfi" align 4 {
+; CHECK: define private void {{.*}} #[[AT:.*]] align 4 {
; CHECK-NEXT: entry:
; CHECK-NEXT: call void asm sideeffect "b.w $0\0Ab.w $1\0A", "s,s"(void ()* @f1.cfi, void ()* @g1.cfi)
; CHECK-NEXT: unreachable
; CHECK-NEXT: }
-; CHECK: define private void {{.*}} #[[AA:.*]] section ".text.cfi" align 4 {
+; CHECK: define private void {{.*}} #[[AA:.*]] align 4 {
; CHECK-NEXT: entry:
; CHECK-NEXT: call void asm sideeffect "b $0\0Ab $1\0Ab $2\0A", "s,s,s"(void ()* @f2.cfi, void ()* @g2.cfi, void ()* @h2.cfi)
; CHECK-NEXT: unreachable
Modified: llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-disjoint.ll Mon May 7 14:30:15 2018
@@ -39,10 +39,10 @@ define i1 @foo(i8* %p) {
ret i1 %z
}
-; X64: define private void @[[JT0]]() #{{.*}} section ".text.cfi" align 8 {
+; X64: define private void @[[JT0]]() #{{.*}} align 8 {
; X64: call void asm sideeffect "jmp ${0:c}@plt\0Aint3\0Aint3\0Aint3\0A", "s"(void ()* @f.cfi)
-; X64: define private void @[[JT1]]() #{{.*}} section ".text.cfi" align 8 {
+; X64: define private void @[[JT1]]() #{{.*}} align 8 {
; X64: call void asm sideeffect "jmp ${0:c}@plt\0Aint3\0Aint3\0Aint3\0A", "s"(void ()* @g.cfi)
; WASM32: ![[I0]] = !{i64 1}
Modified: llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-ext.ll Mon May 7 14:30:15 2018
@@ -22,5 +22,5 @@ declare i1 @llvm.type.test(i8* %ptr, met
; WASM-NOT: !{i64 0}
; WASM-NOT: !{i64 1}
-; X64: define private void @[[JT]]() #{{.*}} section ".text.cfi" align {{.*}} {
+; X64: define private void @[[JT]]() #{{.*}} align {{.*}} {
; X64: call void asm sideeffect "jmp ${0:c}@plt\0Aint3\0Aint3\0Aint3\0A", "s"(void ()* @foo)
Modified: llvm/trunk/test/Transforms/LowerTypeTests/function-weak.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/function-weak.ll?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-weak.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-weak.ll Mon May 7 14:30:15 2018
@@ -50,8 +50,8 @@ define i1 @foo(i8* %p) {
ret i1 %x
}
-; X86: define private void @[[JT]]() #{{.*}} section ".text.cfi" align 8 {
-; ARM: define private void @[[JT]]() #{{.*}} section ".text.cfi" align 4 {
+; X86: define private void @[[JT]]() #{{.*}} align 8 {
+; ARM: define private void @[[JT]]() #{{.*}} align 4 {
; CHECK: define internal void @__cfi_global_var_init() section ".text.startup" {
; CHECK-NEXT: entry:
Modified: llvm/trunk/test/Transforms/LowerTypeTests/function.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/function.ll?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function.ll Mon May 7 14:30:15 2018
@@ -48,10 +48,10 @@ define i1 @foo(i8* %p) {
ret i1 %x
}
-; X86-LINUX: define private void @[[JT]]() #[[ATTR:.*]] section ".text.cfi" align 8 {
-; X86-WIN32: define private void @[[JT]]() #[[ATTR:.*]] section ".text.cfi" align 8 {
-; ARM: define private void @[[JT]]() #[[ATTR:.*]] section ".text.cfi" align 4 {
-; THUMB: define private void @[[JT]]() #[[ATTR:.*]] section ".text.cfi" align 4 {
+; X86-LINUX: define private void @[[JT]]() #[[ATTR:.*]] align 8 {
+; X86-WIN32: define private void @[[JT]]() #[[ATTR:.*]] align 8 {
+; ARM: define private void @[[JT]]() #[[ATTR:.*]] align 4 {
+; THUMB: define private void @[[JT]]() #[[ATTR:.*]] align 4 {
; X86: jmp ${0:c}@plt
; X86-SAME: int3
Modified: llvm/trunk/test/Transforms/LowerTypeTests/section.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/section.ll?rev=331680&r1=331679&r2=331680&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/section.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/section.ll Mon May 7 14:30:15 2018
@@ -19,7 +19,7 @@ entry:
ret i1 %0
}
-; CHECK: define private void @[[JT]]() #{{.*}} section ".text.cfi" align {{.*}} {
+; CHECK: define private void @[[JT]]() #{{.*}} align {{.*}} {
declare i1 @llvm.type.test(i8*, metadata) nounwind readnone
More information about the llvm-commits
mailing list