diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-07-13 17:19:57 +0000 |
| commit | 66e41e3c6e8b8fbc48d5d3b4d2bd9ce0be4ecb75 (patch) | |
| tree | 9de1c5f67a98cd0e73c60838396486c984f63ac2 /lib/Transforms/Utils/AddrModeMatcher.cpp | |
| parent | abdf259d487163e72081a8cf4991b1617206b41e (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/Utils/AddrModeMatcher.cpp')
| -rw-r--r-- | lib/Transforms/Utils/AddrModeMatcher.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/Transforms/Utils/AddrModeMatcher.cpp b/lib/Transforms/Utils/AddrModeMatcher.cpp index ea9d1c1b1468..4d64c8578efe 100644 --- a/lib/Transforms/Utils/AddrModeMatcher.cpp +++ b/lib/Transforms/Utils/AddrModeMatcher.cpp @@ -381,29 +381,28 @@ static bool IsOperandAMemoryOperand(CallInst *CI, InlineAsm *IA, Value *OpVal, const TargetLowering &TLI) { std::vector<InlineAsm::ConstraintInfo> Constraints = IA->ParseConstraints(); - - unsigned ArgNo = 1; // ArgNo - The operand of the CallInst. + + unsigned ArgNo = 0; // The argument of the CallInst. for (unsigned i = 0, e = Constraints.size(); i != e; ++i) { TargetLowering::AsmOperandInfo OpInfo(Constraints[i]); - + // Compute the value type for each operand. switch (OpInfo.Type) { case InlineAsm::isOutput: if (OpInfo.isIndirect) - OpInfo.CallOperandVal = CI->getOperand(ArgNo++); + OpInfo.CallOperandVal = CI->getArgOperand(ArgNo++); break; case InlineAsm::isInput: - OpInfo.CallOperandVal = CI->getOperand(ArgNo++); + OpInfo.CallOperandVal = CI->getArgOperand(ArgNo++); break; case InlineAsm::isClobber: // Nothing to do. break; } - + // Compute the constraint code and ConstraintType to use. - TLI.ComputeConstraintToUse(OpInfo, SDValue(), - OpInfo.ConstraintType == TargetLowering::C_Memory); - + TLI.ComputeConstraintToUse(OpInfo, SDValue()); + // If this asm operand is our Value*, and if it isn't an indirect memory // operand, we can't fold it! if (OpInfo.CallOperandVal == OpVal && @@ -411,7 +410,7 @@ static bool IsOperandAMemoryOperand(CallInst *CI, InlineAsm *IA, Value *OpVal, !OpInfo.isIndirect)) return false; } - + return true; } @@ -450,7 +449,7 @@ static bool FindAllMemoryUses(Instruction *I, if (CallInst *CI = dyn_cast<CallInst>(U)) { InlineAsm *IA = dyn_cast<InlineAsm>(CI->getCalledValue()); - if (IA == 0) return true; + if (!IA) return true; // If this is a memory operand, we're cool, otherwise bail out. if (!IsOperandAMemoryOperand(CI, IA, I, TLI)) |
