Fix incorrect invariant check in DAG Combine
[oota-llvm.git] / lib / CodeGen / SelectionDAG / DAGCombiner.cpp
index acea763f5babde8935cccf52673477c82c6064b9..0d5cabaaf27d2166003e47f56e671c9f3054577b 100644 (file)
@@ -11542,7 +11542,7 @@ bool DAGCombiner::SimplifySelectOps(SDNode *TheSelect, SDValue LHS,
     // It is safe to replace the two loads if they have different alignments,
     // but the new load must be the minimum (most restrictive) alignment of the
     // inputs.
-    bool isInvariant = LLD->getAlignment() & RLD->getAlignment();
+    bool isInvariant = LLD->isInvariant() & RLD->isInvariant();
     unsigned Alignment = std::min(LLD->getAlignment(), RLD->getAlignment());
     if (LLD->getExtensionType() == ISD::NON_EXTLOAD) {
       Load = DAG.getLoad(TheSelect->getValueType(0),