aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-03-22 23:25:07 +0000
committerBill Wendling <isanbard@gmail.com>2012-03-22 23:25:07 +0000
commitacb5310542b82e7acf5f5a91fa619e4b7efeff5c (patch)
tree467f3b268bcdf901a2450cf1f173703f6d135ea6 /lib/CodeGen/CGStmt.cpp
parentbce35a221752a1ca6d2a70e8592b47b7cc1ec90d (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.cpp7
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);