diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-03-22 23:25:07 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-03-22 23:25:07 +0000 |
commit | acb5310542b82e7acf5f5a91fa619e4b7efeff5c (patch) | |
tree | 467f3b268bcdf901a2450cf1f173703f6d135ea6 /lib/CodeGen/CGStmt.cpp | |
parent | bce35a221752a1ca6d2a70e8592b47b7cc1ec90d (diff) |
When an MMX output variable is tied to the input variable, we have to implicitly
cast the value to x86_mmx. This gives the ASM string the correct call signature.
<rdar://problem/10919182>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153290 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r-- | lib/CodeGen/CGStmt.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index e65c5f468f..670167b959 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -1507,6 +1507,11 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { llvm::Value *Arg = EmitAsmInputLValue(S, Info, Dest, InputExpr->getType(), InOutConstraints); + if (llvm::Type* AdjTy = + getTargetHooks().adjustInlineAsmType(*this, OutputConstraint, + Arg->getType())) + Arg = Builder.CreateBitCast(Arg, AdjTy); + if (Info.allowsRegister()) InOutConstraints += llvm::utostr(i); else @@ -1565,7 +1570,7 @@ void CodeGenFunction::EmitAsmStmt(const AsmStmt &S) { } } } - if (llvm::Type* AdjTy = + if (llvm::Type* AdjTy = getTargetHooks().adjustInlineAsmType(*this, InputConstraint, Arg->getType())) Arg = Builder.CreateBitCast(Arg, AdjTy); |