[PATCH] [SelectionDAG] Fix PR23603.

hfinkel at anl.gov hfinkel at anl.gov
Mon Jun 1 06:09:19 PDT 2015


LGTM.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:2851
@@ -2850,2 +2850,3 @@
   bool isNonTemporal = I.getMetadata(LLVMContext::MD_nontemporal) != nullptr;
-  bool isInvariant = I.getMetadata(LLVMContext::MD_invariant_load) != nullptr;
+  bool isInvariant = I.getMetadata(LLVMContext::MD_invariant_load) != nullptr &&
+    isDereferenceablePointer(SV, *DAG.getTarget().getDataLayout());
----------------
Please add a comment here explaining why the dereferenceability check is needed.

http://reviews.llvm.org/D10075

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






More information about the llvm-commits mailing list