Don't try to use pre-indexed addressing with sthbrx/stwbrx
authorDan Gohman <gohman@apple.com>
Fri, 25 Sep 2009 00:57:30 +0000 (00:57 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 25 Sep 2009 00:57:30 +0000 (00:57 +0000)
instructions. This fixes a PowerPC bug exposed by some unrelated
changes I'm working on.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82743 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCISelLowering.cpp

index 88e2b0724fc4b811a5bf1b61bd2228d26a6ac905..3b05679364dca7f6af14b28fb817343cedfbbaf6 100644 (file)
@@ -4921,7 +4921,8 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N,
     }
 
     // Turn STORE (BSWAP) -> sthbrx/stwbrx.
-    if (N->getOperand(1).getOpcode() == ISD::BSWAP &&
+    if (cast<StoreSDNode>(N)->isUnindexed() &&
+        N->getOperand(1).getOpcode() == ISD::BSWAP &&
         N->getOperand(1).getNode()->hasOneUse() &&
         (N->getOperand(1).getValueType() == MVT::i32 ||
          N->getOperand(1).getValueType() == MVT::i16)) {