llvm.org GIT mirror llvm / 14e2ea9
Revise previous patch per review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47573 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 12 years ago
1 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
58845884 isa(St->getValue()) &&
58855885 !cast(St->getValue())->isVolatile() &&
58865886 St->getChain().hasOneUse() && !St->isVolatile()) {
5887 SDNode* LdVal = St->getValue().Val;
58875888 LoadSDNode *Ld = 0;
58885889 int TokenFactorIndex = -1;
58895890 SmallVector Ops;
58915892 // Must be a store of a load. We currently handle two cases: the load
58925893 // is a direct child, and it's under an intervening TokenFactor. It is
58935894 // possible to dig deeper under nested TokenFactors.
5894 if (ChainVal == St->getValue().Val)
5895 if (ChainVal == LdVal)
58955896 Ld = cast(St->getChain());
58965897 else if (St->getValue().hasOneUse() &&
58975898 ChainVal->getOpcode() == ISD::TokenFactor) {
58985899 for (unsigned i=0, e = ChainVal->getNumOperands(); i != e; ++i) {
5899 if (ChainVal->getOperand(i).Val == St->getValue().Val) {
5900 if (TokenFactorIndex != -1)
5901 return SDOperand();
5900 if (ChainVal->getOperand(i).Val == LdVal) {
59025901 TokenFactorIndex = i;
59035902 Ld = cast(St->getValue());
59045903 } else