[llvm] r331008 - [LowerTypeTests] Mark .cfi.jumptable nounwind.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 26 17:32:24 PDT 2018


Author: efriedma
Date: Thu Apr 26 17:32:24 2018
New Revision: 331008

URL: http://llvm.org/viewvc/llvm-project?rev=331008&view=rev
Log:
[LowerTypeTests] Mark .cfi.jumptable nounwind.

It doesn't unwind, and the wrong marking leads to the creation of an
.eh_frame section when it isn't necessary.

Differential Revision: https://reviews.llvm.org/D46082


Modified:
    llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
    llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll
    llvm/trunk/test/Transforms/LowerTypeTests/function.ll

Modified: llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp?rev=331008&r1=331007&r2=331008&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/LowerTypeTests.cpp Thu Apr 26 17:32:24 2018
@@ -1290,6 +1290,8 @@ void LowerTypeTestsModule::createJumpTab
     // by Clang for -march=armv7.
     F->addFnAttr("target-cpu", "cortex-a8");
   }
+  // Make sure we don't emit .eh_frame for this function.
+  F->addFnAttr(Attribute::NoUnwind);
 
   BasicBlock *BB = BasicBlock::Create(M.getContext(), "entry", F);
   IRBuilder<> IRB(BB);

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=331008&r1=331007&r2=331008&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function-arm-thumb.ll Thu Apr 26 17:32:24 2018
@@ -37,5 +37,5 @@ define void @h2() "target-features"="-th
 ; CHECK-NEXT:  unreachable
 ; CHECK-NEXT: }
 
-; CHECK-DAG: attributes #[[AA]] = { naked "target-features"="-thumb-mode" }
-; CHECK-DAG: attributes #[[AT]] = { naked "target-cpu"="cortex-a8" "target-features"="+thumb-mode" }
+; CHECK-DAG: attributes #[[AA]] = { naked nounwind "target-features"="-thumb-mode" }
+; CHECK-DAG: attributes #[[AT]] = { naked nounwind "target-cpu"="cortex-a8" "target-features"="+thumb-mode" }

Modified: llvm/trunk/test/Transforms/LowerTypeTests/function.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerTypeTests/function.ll?rev=331008&r1=331007&r2=331008&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/LowerTypeTests/function.ll (original)
+++ llvm/trunk/test/Transforms/LowerTypeTests/function.ll Thu Apr 26 17:32:24 2018
@@ -49,7 +49,7 @@ define i1 @foo(i8* %p) {
 }
 
 ; X86-LINUX:   define private void @[[JT]]() #[[ATTR:.*]] section ".text.cfi" align 8 {
-; X86-WIN32:   define private void @[[JT]]() 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 {
 
@@ -70,9 +70,10 @@ define i1 @foo(i8* %p) {
 
 ; NATIVE-SAME: "s,s"(void ()* @f.cfi, void ()* @g.cfi)
 
-; X86-LINUX: attributes #[[ATTR]] = { {{.*}}naked
-; ARM: attributes #[[ATTR]] = { {{.*}}naked
-; THUMB: attributes #[[ATTR]] = { {{.*}}naked{{.*}}"target-cpu"="cortex-a8"
+; X86-LINUX: attributes #[[ATTR]] = { naked nounwind }
+; X86-WIN32: attributes #[[ATTR]] = { nounwind }
+; ARM: attributes #[[ATTR]] = { naked nounwind
+; THUMB: attributes #[[ATTR]] = { naked nounwind "target-cpu"="cortex-a8" "target-features"="+thumb-mode" }
 
 ; WASM32: ![[I0]] = !{i64 1}
 ; WASM32: ![[I1]] = !{i64 2}




More information about the llvm-commits mailing list