diff options
author | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2010-09-13 18:15:37 +0000 |
---|---|---|
committer | John Thompson <John.Thompson.JTSoftware@gmail.com> | 2010-09-13 18:15:37 +0000 |
commit | eac6e1d0c748afc3d1496be0753ffbe5f5a4279b (patch) | |
tree | 94079e066b7fbaf541433ad07e9453331d09b7ba /lib/Transforms/Scalar/CodeGenPrepare.cpp | |
parent | c32a2260a6145000581a74fd61ba57bdcc4cb951 (diff) | |
download | external_llvm-eac6e1d0c748afc3d1496be0753ffbe5f5a4279b.zip external_llvm-eac6e1d0c748afc3d1496be0753ffbe5f5a4279b.tar.gz external_llvm-eac6e1d0c748afc3d1496be0753ffbe5f5a4279b.tar.bz2 |
Added skeleton for inline asm multiple alternative constraint support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113766 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index e07b761..8c3f574 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -738,33 +738,10 @@ bool CodeGenPrepare::OptimizeInlineAsmInst(Instruction *I, CallSite CS, bool MadeChange = false; InlineAsm *IA = cast<InlineAsm>(CS.getCalledValue()); - // Do a prepass over the constraints, canonicalizing them, and building up the - // ConstraintOperands list. - std::vector<InlineAsm::ConstraintInfo> - ConstraintInfos = IA->ParseConstraints(); - - /// ConstraintOperands - Information about all of the constraints. - std::vector<TargetLowering::AsmOperandInfo> ConstraintOperands; - unsigned ArgNo = 0; // ArgNo - The argument of the CallInst. - for (unsigned i = 0, e = ConstraintInfos.size(); i != e; ++i) { - ConstraintOperands. - push_back(TargetLowering::AsmOperandInfo(ConstraintInfos[i])); - TargetLowering::AsmOperandInfo &OpInfo = ConstraintOperands.back(); - - // Compute the value type for each operand. - switch (OpInfo.Type) { - case InlineAsm::isOutput: - if (OpInfo.isIndirect) - OpInfo.CallOperandVal = CS.getArgument(ArgNo++); - break; - case InlineAsm::isInput: - OpInfo.CallOperandVal = CS.getArgument(ArgNo++); - break; - case InlineAsm::isClobber: - // Nothing to do. - break; - } - + std::vector<TargetLowering::AsmOperandInfo> TargetConstraints = TLI->ParseConstraints(CS); + for (unsigned i = 0, e = TargetConstraints.size(); i != e; ++i) { + TargetLowering::AsmOperandInfo &OpInfo = TargetConstraints[i]; + // Compute the constraint code and ConstraintType to use. TLI->ComputeConstraintToUse(OpInfo, SDValue()); |