Avoid replacing the value of a directly stored load with the stored value if the...
[oota-llvm.git] / lib / CodeGen / SelectionDAG / DAGCombiner.cpp
index 4c70bc3e88b8d2ce088543855099614cde4911a9..f9f89858c97c4e8922b53c7494ad97cf72f8483c 100644 (file)
@@ -5862,8 +5862,7 @@ SDValue DAGCombiner::visitLOAD(SDNode *N) {
   // value.
   // TODO: Handle store large -> read small portion.
   // TODO: Handle TRUNCSTORE/LOADEXT
-  if (LD->getExtensionType() == ISD::NON_EXTLOAD &&
-      !LD->isVolatile()) {
+  if (ISD::isNormalLoad(N) && !LD->isVolatile()) {
     if (ISD::isNON_TRUNCStore(Chain.getNode())) {
       StoreSDNode *PrevST = cast<StoreSDNode>(Chain);
       if (PrevST->getBasePtr() == Ptr &&