[PATCH] DAGCombiner: Assume invariant load cannot alias a store

Philip Reames listmail at philipreames.com
Fri Jun 26 11:38:01 PDT 2015


================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13821
@@ +13820,3 @@
+  // they cannot alias.
+  if (Op0->isInvariant() && Op1->writeMem())
+    return false;
----------------
Not sure about this, but is writeMem correct here?  At least most places, we use a conservative notion for writes.  i.e. it *may* write, not it *must* write.  If we had an instruction which may write, but actually just reads in this context, the aliasing could be wrong.  

!mayLoad might be a possibility.

================
Comment at: lib/CodeGen/SelectionDAG/DAGCombiner.cpp:13832
@@ -13823,3 +13831,3 @@
   const void *CV1, *CV2;
   bool isFrameIndex1 = FindBaseOffset(Op0->getBasePtr(),
                                       Base1, Offset1, GV1, CV1);
----------------
Is this case handled by the UseAA option below?  I'd really expect it to be.  Is enabling that for your target an option?

http://reviews.llvm.org/D10749

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list