[llvm-branch-commits] [llvm-branch] r311602 - Merging r311565:

Hans Wennborg via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Aug 23 14:30:38 PDT 2017


Author: hans
Date: Wed Aug 23 14:30:37 2017
New Revision: 311602

URL: http://llvm.org/viewvc/llvm-project?rev=311602&view=rev
Log:
Merging r311565:
------------------------------------------------------------------------
r311565 | hans | 2017-08-23 08:43:28 -0700 (Wed, 23 Aug 2017) | 8 lines

LowerAtomic: Don't skip optnone functions; atomic still need lowering (PR34020)

The lowering isn't really an optimization, so optnone shouldn't make a
difference. ARM relies on the pass running when using "-mthread-model
single", because in that mode, it doesn't run AtomicExpand. See bug for
more details.

Differential Revision: https://reviews.llvm.org/D37040
------------------------------------------------------------------------

Modified:
    llvm/branches/release_50/   (props changed)
    llvm/branches/release_50/lib/Transforms/Scalar/LowerAtomic.cpp
    llvm/branches/release_50/test/Feature/optnone-opt.ll
    llvm/branches/release_50/test/Transforms/LowerAtomic/atomic-swap.ll

Propchange: llvm/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Aug 23 14:30:37 2017
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,308483-308484,308503,308808,308813,308847,308891,308906,308950,308963,308978,308986,309044,309071,309113,309120,309122,309140,309227,309302,309321,309323,309325,309330,309343,309353,309355,309422,309481,309483,309495,309555,309561,309594,309614,309651,309744,309758,309849,309928,309930,309945,310066,310071,310190,310240-310242,310250,310253,310262,310267,310481,310492,310498,310510,310534,310552,310604,310712,310779,310784,310796,310842,310906,310926,310939,310979,310988,310990-310991,311061,311068,311071,311087,311229,311258,311263,311387,311429,311572
+/llvm/trunk:155241,308483-308484,308503,308808,308813,308847,308891,308906,308950,308963,308978,308986,309044,309071,309113,309120,309122,309140,309227,309302,309321,309323,309325,309330,309343,309353,309355,309422,309481,309483,309495,309555,309561,309594,309614,309651,309744,309758,309849,309928,309930,309945,310066,310071,310190,310240-310242,310250,310253,310262,310267,310481,310492,310498,310510,310534,310552,310604,310712,310779,310784,310796,310842,310906,310926,310939,310979,310988,310990-310991,311061,311068,311071,311087,311229,311258,311263,311387,311429,311565,311572

Modified: llvm/branches/release_50/lib/Transforms/Scalar/LowerAtomic.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/lib/Transforms/Scalar/LowerAtomic.cpp?rev=311602&r1=311601&r2=311602&view=diff
==============================================================================
--- llvm/branches/release_50/lib/Transforms/Scalar/LowerAtomic.cpp (original)
+++ llvm/branches/release_50/lib/Transforms/Scalar/LowerAtomic.cpp Wed Aug 23 14:30:37 2017
@@ -155,8 +155,7 @@ public:
   }
 
   bool runOnFunction(Function &F) override {
-    if (skipFunction(F))
-      return false;
+    // Don't skip optnone functions; atomics still need to be lowered.
     FunctionAnalysisManager DummyFAM;
     auto PA = Impl.run(F, DummyFAM);
     return !PA.areAllPreserved();

Modified: llvm/branches/release_50/test/Feature/optnone-opt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/test/Feature/optnone-opt.ll?rev=311602&r1=311601&r2=311602&view=diff
==============================================================================
--- llvm/branches/release_50/test/Feature/optnone-opt.ll (original)
+++ llvm/branches/release_50/test/Feature/optnone-opt.ll Wed Aug 23 14:30:37 2017
@@ -57,7 +57,6 @@ attributes #0 = { optnone noinline }
 ; Additional IR passes that opt doesn't turn on by default.
 ; OPT-MORE-DAG: Skipping pass 'Dead Code Elimination'
 ; OPT-MORE-DAG: Skipping pass 'Dead Instruction Elimination'
-; OPT-MORE-DAG: Skipping pass 'Lower atomic intrinsics
 
 ; Loop IR passes that opt doesn't turn on by default.
 ; OPT-LOOP-DAG: Skipping pass 'Delete dead loops'

Modified: llvm/branches/release_50/test/Transforms/LowerAtomic/atomic-swap.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/test/Transforms/LowerAtomic/atomic-swap.ll?rev=311602&r1=311601&r2=311602&view=diff
==============================================================================
--- llvm/branches/release_50/test/Transforms/LowerAtomic/atomic-swap.ll (original)
+++ llvm/branches/release_50/test/Transforms/LowerAtomic/atomic-swap.ll Wed Aug 23 14:30:37 2017
@@ -26,3 +26,14 @@ define i8 @swap() {
   ret i8 %j
 ; CHECK: ret i8 [[INST]]
 }
+
+
+define i8 @swap_optnone() noinline optnone {
+; CHECK-LABEL: @swap_optnone(
+  %i = alloca i8
+  %j = atomicrmw xchg i8* %i, i8 42 monotonic
+; CHECK: [[INST:%[a-z0-9]+]] = load
+; CHECK-NEXT: store
+  ret i8 %j
+; CHECK: ret i8 [[INST]]
+}




More information about the llvm-branch-commits mailing list