[PATCH] Remove -arm-disable-ehabi flag

Renato Golin renato.golin at linaro.org
Fri Feb 7 11:41:29 PST 2014


Hi keith.walker.arm, asl, logan, rnk,

The -arm-disable-ehabi flag was a temporary short-cut to make sure if anything serious was broken when we moved EHABI to run by default, it could easily be reverted and re-tested, but it's now in the way of a bigger refactoring of the code, which will make this flag redundant.

http://llvm-reviews.chandlerc.com/D2722

Files:
  lib/CodeGen/AsmPrinter/ARMException.cpp
  lib/Target/ARM/ARMAsmPrinter.cpp
  lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
  test/CodeGen/ARM/setcc-sentinals.ll
  test/CodeGen/Thumb2/constant-islands.ll
  test/MC/ARM/data-in-code.ll

Index: lib/CodeGen/AsmPrinter/ARMException.cpp
===================================================================
--- lib/CodeGen/AsmPrinter/ARMException.cpp
+++ lib/CodeGen/AsmPrinter/ARMException.cpp
@@ -52,6 +52,8 @@
 /// beginFunction - Gather pre-function exception information. Assumes it's
 /// being emitted immediately after the function entry point.
 void ARMException::beginFunction(const MachineFunction *MF) {
+  // FIXME: .fnstart / .fnend force the generation of the tables, so it should
+  // really go inside the if below, just like Dwarf unwinding.
   getTargetStreamer().emitFnStart();
   if (Asm->MF->getFunction()->needsUnwindTableEntry())
     Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_begin",
@@ -62,8 +64,12 @@
 ///
 void ARMException::endFunction(const MachineFunction *) {
   ARMTargetStreamer &ATS = getTargetStreamer();
+  // FIXME: This is assuming we'll always generate unwinding tables, which is
+  // true now, but when you change the other FIXMEs in this file (and in
+  // ARMAsmPrinter's EmitInstructions (FrameSetup)), we need to make sure we
+  // change here, too.
   if (!Asm->MF->getFunction()->needsUnwindTableEntry())
-    ATS.emitCantUnwind();
+    ATS.emitCantUnwind(); // Should really be below, checking nothrow
   else {
     Asm->OutStreamer.EmitLabel(Asm->GetTempSymbol("eh_func_end",
                                                   Asm->getFunctionNumber()));
@@ -88,6 +94,8 @@
     }
   }
 
+  // FIXME: .fnstart / .fnend force the generation of the tables, so it should
+  // really go inside the if above, just like Dwarf unwinding.
   ATS.emitFnEnd();
 }
 
Index: lib/Target/ARM/ARMAsmPrinter.cpp
===================================================================
--- lib/Target/ARM/ARMAsmPrinter.cpp
+++ lib/Target/ARM/ARMAsmPrinter.cpp
@@ -1104,8 +1104,6 @@
   }
 }
 
-extern cl::opt<bool> DisableARMEHABI;
-
 // Simple pseudo-instructions have their lowering (with expansion to real
 // instructions) auto-generated.
 #include "ARMGenMCPseudoLowering.inc"
@@ -1120,7 +1118,8 @@
   }
 
   // Emit unwinding stuff for frame-related instructions
-  if (Subtarget->isTargetEHABICompatible() && !DisableARMEHABI &&
+  // FIXME: Check uwtables before emitting frame setup directives
+  if (Subtarget->isTargetEHABICompatible() &&
        MI->getFlag(MachineInstr::FrameSetup))
     EmitUnwindingInstruction(MI);
 
Index: lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
===================================================================
--- lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
+++ lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
@@ -16,14 +16,6 @@
 
 using namespace llvm;
 
-// ARM EHABI is experimental but the quality is good enough
-// to be turned on by default on non-Darwin ARM targets.
-cl::opt<bool>
-DisableARMEHABI("arm-disable-ehabi", cl::Hidden,
-  cl::desc("Disable ARM experimental exception handling"),
-  cl::init(false));
-
-
 void ARMMCAsmInfoDarwin::anchor() { }
 
 ARMMCAsmInfoDarwin::ARMMCAsmInfoDarwin() {
@@ -54,8 +46,7 @@
   SupportsDebugInformation = true;
 
   // Exceptions handling
-  if (!DisableARMEHABI)
-    ExceptionsType = ExceptionHandling::ARM;
+  ExceptionsType = ExceptionHandling::ARM;
 
   // foo(plt) instead of foo at plt
   UseParensForSymbolVariant = true;
Index: test/CodeGen/ARM/setcc-sentinals.ll
===================================================================
--- test/CodeGen/ARM/setcc-sentinals.ll
+++ test/CodeGen/ARM/setcc-sentinals.ll
@@ -1,7 +1,8 @@
-; RUN: llc < %s -mcpu=cortex-a8 -march=arm -asm-verbose=false -arm-disable-ehabi | FileCheck %s
+; RUN: llc < %s -mcpu=cortex-a8 -march=arm -asm-verbose=false | FileCheck %s
 
 define zeroext i1 @test0(i32 %x) nounwind {
 ; CHECK-LABEL: test0:
+; CHECK-NEXT: .fnstart
 ; CHECK-NEXT: add [[REG:(r[0-9]+)|(lr)]], r0, #1
 ; CHECK-NEXT: mov r0, #0
 ; CHECK-NEXT: cmp [[REG]], #1
Index: test/CodeGen/Thumb2/constant-islands.ll
===================================================================
--- test/CodeGen/Thumb2/constant-islands.ll
+++ test/CodeGen/Thumb2/constant-islands.ll
@@ -1,7 +1,7 @@
-; RUN: llc < %s -march=arm   -mcpu=cortex-a8 -O0 -filetype=obj -o %t.o -arm-disable-ehabi
-; RUN: llc < %s -march=thumb -mcpu=cortex-a8 -O0 -filetype=obj -o %t.o -arm-disable-ehabi
-; RUN: llc < %s -march=arm   -mcpu=cortex-a8 -O2 -filetype=obj -verify-machineinstrs -o %t.o -arm-disable-ehabi
-; RUN: llc < %s -march=thumb -mcpu=cortex-a8 -O2 -filetype=obj -verify-machineinstrs -o %t.o -arm-disable-ehabi
+; RUN: llc < %s -march=arm   -mcpu=cortex-a8 -O0 -filetype=obj -o %t.o
+; RUN: llc < %s -march=thumb -mcpu=cortex-a8 -O0 -filetype=obj -o %t.o
+; RUN: llc < %s -march=arm   -mcpu=cortex-a8 -O2 -filetype=obj -verify-machineinstrs -o %t.o
+; RUN: llc < %s -march=thumb -mcpu=cortex-a8 -O2 -filetype=obj -verify-machineinstrs -o %t.o
 target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:32:64-v128:32:128-a0:0:32-n32-S32"
 target triple = "thumbv7-apple-ios"
 
Index: test/MC/ARM/data-in-code.ll
===================================================================
--- test/MC/ARM/data-in-code.ll
+++ test/MC/ARM/data-in-code.ll
@@ -1,8 +1,8 @@
-;; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -arm-disable-ehabi \
+;; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort \
 ;; RUN:   -mtriple=armv7-linux-gnueabi -filetype=obj %s -o - | \
 ;; RUN:   llvm-readobj -t | FileCheck -check-prefix=ARM %s
 
-;; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort -arm-disable-ehabi \
+;; RUN: llc -O0 -verify-machineinstrs -fast-isel-abort \
 ;; RUN:   -mtriple=thumbv7-linux-gnueabi -filetype=obj %s -o - | \
 ;; RUN:   llvm-readobj -t | FileCheck -check-prefix=TMB %s
 
@@ -144,6 +144,16 @@
 ;; ARM-NEXT:     Other:
 ;; ARM-NEXT:     Section: [[MIXED_SECT]]
 
+;; ARM:        Symbol {
+;; ARM:          Name: $d
+;; ARM-NEXT:     Value: 0x0
+;; ARM-NEXT:     Size: 0
+;; ARM-NEXT:     Binding: Local (0x0)
+;; ARM-NEXT:     Type: None (0x0)
+;; ARM-NEXT:     Other: 0
+;; ARM-NEXT:     Section: .ARM.exidx
+;; ARM-NEXT:   }
+
 ;; ARM-NOT:     ${{[atd]}}
 
 ;; TMB:        Symbol {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2722.1.patch
Type: text/x-patch
Size: 6114 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140207/a465bc43/attachment.bin>


More information about the llvm-commits mailing list