From: Dan Gohman Date: Fri, 25 Sep 2009 00:57:30 +0000 (+0000) Subject: Don't try to use pre-indexed addressing with sthbrx/stwbrx X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6acaaa8f32a52772952c2171ad8ee1f7a896a1c9;p=oota-llvm.git Don't try to use pre-indexed addressing with sthbrx/stwbrx 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 --- diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index 88e2b0724fc..3b05679364d 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -4921,7 +4921,8 @@ SDValue PPCTargetLowering::PerformDAGCombine(SDNode *N, } // Turn STORE (BSWAP) -> sthbrx/stwbrx. - if (N->getOperand(1).getOpcode() == ISD::BSWAP && + if (cast(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)) {