[llvm] r284572 - Revert of r284571 because of failing tests.

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 00:45:49 PDT 2016


Author: sjoerdmeijer
Date: Wed Oct 19 02:45:48 2016
New Revision: 284572

URL: http://llvm.org/viewvc/llvm-project?rev=284572&view=rev
Log:
Revert of r284571 because of failing tests.

Removed:
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr0.ll
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr1.ll
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr2.ll
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr3.ll
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr4.ll
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr5.ll
    llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll
Modified:
    llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp?rev=284572&r1=284571&r2=284572&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMAsmPrinter.cpp Wed Oct 19 02:45:48 2016
@@ -633,17 +633,17 @@ static ARMBuildAttrs::CPUArch getArchFor
     return ARMBuildAttrs::v4;
 }
 
-// Returns true if all functions have the same function attribute value.
-// It also returns true when there are no functions, or when
-// the particular function attribute is not set to a value.
-static bool checkFunctionsAttributeConsistency(const Module &M, StringRef Attr,
-                                               StringRef Value) {
-  return !any_of(M, [&](const Function &F) {
-    return F.hasFnAttribute(Attr) &&
-           F.getFnAttribute(Attr).getValueAsString() != Value;
-  });
+// Returns true if all functions have the same function attribute value
+static bool haveAllFunctionsAttribute(const Module &M, StringRef Attr,
+                                      StringRef Value) {
+  for (auto &F : M)
+    if (F.getFnAttribute(Attr).getValueAsString() != Value)
+      return false;
+
+  return true;
 }
 
+
 void ARMAsmPrinter::emitAttributes() {
   MCTargetStreamer &TS = *OutStreamer->getTargetStreamer();
   ARMTargetStreamer &ATS = static_cast<ARMTargetStreamer &>(TS);
@@ -781,15 +781,13 @@ void ARMAsmPrinter::emitAttributes() {
   }
 
   // Set FP Denormals.
-  if (checkFunctionsAttributeConsistency(*MMI->getModule(),
-                                         "denormal-fp-math",
-                                         "preserve-sign") ||
+  if (haveAllFunctionsAttribute(*MMI->getModule(), "denormal-fp-math",
+                                "preserve-sign") ||
       TM.Options.FPDenormalMode == FPDenormal::PreserveSign)
     ATS.emitAttribute(ARMBuildAttrs::ABI_FP_denormal,
                       ARMBuildAttrs::PreserveFPSign);
-  else if (checkFunctionsAttributeConsistency(*MMI->getModule(),
-                                              "denormal-fp-math",
-                                              "positive-zero") ||
+  else if (haveAllFunctionsAttribute(*MMI->getModule(), "denormal-fp-math",
+                                     "positive-zero") ||
            TM.Options.FPDenormalMode == FPDenormal::PositiveZero)
     ATS.emitAttribute(ARMBuildAttrs::ABI_FP_denormal,
                       ARMBuildAttrs::PositiveZero);
@@ -823,8 +821,7 @@ void ARMAsmPrinter::emitAttributes() {
   }
 
   // Set FP exceptions and rounding
-  if (checkFunctionsAttributeConsistency(*MMI->getModule(),
-                                         "no-trapping-math", "true") ||
+  if (haveAllFunctionsAttribute(*MMI->getModule(), "no-trapping-math", "true") ||
       TM.Options.NoTrappingFPMath)
     ATS.emitAttribute(ARMBuildAttrs::ABI_FP_exceptions,
                       ARMBuildAttrs::Not_Allowed);

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr0.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr0.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr0.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr0.ll (removed)
@@ -1,11 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
-; as function attributes, which map on to build attributes ABI_FP_exceptions
-; ABI_FP_denormal. In the backend we therefore have a check to see if all
-; functions have consistent function attributes values. This check also returns
-; true when the compilation unit does not have any functions (i.e. the
-; attributes are consistent), which is what we check with this regression test.
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK:  .eabi_attribute 20, 2
-; CHECK:  .eabi_attribute 21, 0

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr1.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr1.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr1.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr1.ll (removed)
@@ -1,18 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed as
-; function attributes, which map on to build attributes ABI_FP_exceptions ABI_FP_denormal.
-; In the backend we have a check to see if all functions have consistent function
-; attributes values. This checks the "default" behaviour when these FP function
-; attributes are not set at all.
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK: .eabi_attribute 20, 2
-; CHECK: .eabi_attribute 21, 0
-
-
-define i32 @foo_no_fn_attr() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-attributes #0 = { minsize norecurse nounwind optsize readnone }

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr2.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr2.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr2.ll (removed)
@@ -1,18 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
-; as function attributes, which map on to build attributes ABI_FP_exceptions
-; ABI_FP_denormal. In the backend we therefore have a check to see if all
-; functions have consistent function attributes values.
-; Here we just test correct output for specific values of no trapping math
-; and denormals.
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK: .eabi_attribute 20, 1
-; CHECK: .eabi_attribute 21, 1
-
-define i32 @foo() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-attributes #0 = { minsize norecurse nounwind optsize readnone "no-trapping-math"="false" "denormal-fp-math"="ieee"}

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr3.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr3.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr3.ll (removed)
@@ -1,17 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
-; as function attributes, which map on to build attributes ABI_FP_exceptions
-; ABI_FP_denormal. In the backend we therefore have a check to see if all
-; functions have consistent function attributes values.
-; Here we check: no-trapping-math=true
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK: .eabi_attribute 20, 1
-; CHECK: .eabi_attribute 21, 0
-
-define i32 @foo() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-attributes #0 = { minsize norecurse nounwind optsize readnone "no-trapping-math"="true"}

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr4.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr4.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr4.ll (removed)
@@ -1,22 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
-; as function attributes, which map on to build attributes ABI_FP_exceptions
-; ABI_FP_denormal. In the backend we therefore have a check to see if all
-; functions have consistent function attributes values.
-; Here we check: denormal-fp-math=positive-zero
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK: .eabi_attribute 20, 0
-; CHECK: .eabi_attribute 21, 0
-
-define i32 @foo1() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-define i32 @foo2() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="positive-zero"}

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr5.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr5.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr5.ll (removed)
@@ -1,22 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
-; as function attributes, which map on to build attributes ABI_FP_exceptions
-; ABI_FP_denormal. In the backend we therefore have a check to see if all
-; functions have consistent function attributes values.
-; Here we check: denormal-fp-math=preserve-sign
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK: .eabi_attribute 20, 2
-; CHECK: .eabi_attribute 21, 0
-
-define i32 @foo1() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-define i32 @foo2() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="preserve-sign"}

Removed: llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll?rev=284571&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/build-attributes-fn-attr6.ll (removed)
@@ -1,23 +0,0 @@
-; Check FP options -fno-trapping-math and -fdenormal-fp-math. They are passed
-; as function attributes, which map on to build attributes ABI_FP_exceptions
-; ABI_FP_denormal. In the backend we therefore have a check to see if all
-; functions have consistent function attributes values. Here we check two
-; functions have inconsistent values, and that a default is returned. 
-
-; RUN: llc < %s -mtriple=armv7-linux-gnueabi -mcpu=cortex-a15  | FileCheck %s --check-prefix=CHECK
-
-; CHECK: .eabi_attribute 20, 0
-; CHECK: .eabi_attribute 21, 0
-
-define i32 @foo1() local_unnamed_addr #0 {
-entry:
-  ret i32 42
-}
-
-define i32 @foo2() local_unnamed_addr #1 {
-entry:
-  ret i32 42
-}
-
-attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="preserve-sign"}
-attributes #0 = { minsize norecurse nounwind optsize readnone "denormal-fp-math"="positive-zero"}




More information about the llvm-commits mailing list