[PATCH] D19800: [PR27599] [SystemZ] [SelectionDAG] Fix extension of atomic cmpxchg result.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 05:21:41 PDT 2016


koriakin added inline comments.

================
Comment at: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:2872
@@ -2857,3 +2871,3 @@
 
-    Results.push_back(LHS.getValue(0));
+    Results.push_back(ExtRes.getValue(0));
     Results.push_back(Success);
----------------
dsanders wrote:
> I'm not sure why the ANY_EXTEND case returns `ExtRes.getValue(0)` instead of `LHS.getValue(0)`. Is there a reason for it?
> 
> I'm currently thinking that returning LHS allows SelectionDAG to take advantage of the additional known-zero bits from the zero extend but returning ExtRes allows more scheduling freedom because it can be used before the comparison completes. I'm not sure which is the better choice though.
The comparison result may be unused and DCEd - in this case, it's better not to do the zero extension at all.


Repository:
  rL LLVM

http://reviews.llvm.org/D19800





More information about the llvm-commits mailing list