diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2008-12-16 18:21:39 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2008-12-16 18:21:39 +0000 |
| commit | c35fc49477bd0efa0f5a5224ea4487235ceac8c3 (patch) | |
| tree | 8212b0273880fb34e1076b8cae8916de6aca16fe /llvm/lib/CodeGen | |
| parent | 3a1bb221781975b85ac11b484212b7eb8f30a1b4 (diff) | |
| download | bcm5719-llvm-c35fc49477bd0efa0f5a5224ea4487235ceac8c3.tar.gz bcm5719-llvm-c35fc49477bd0efa0f5a5224ea4487235ceac8c3.zip | |
We have decided not to support inline asm where an output operand with a matching input operand with incompatible type (i.e. either one is a floating point and the other is an integer or the sizes of the types differ). SelectionDAGBuild will catch these and exit with an error.
llvm-svn: 61092
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index a5a4896b700..853e0549f75 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -5048,20 +5048,21 @@ void SelectionDAGLowering::visitInlineAsm(CallSite CS) { SDISelAsmOperandInfo &OpInfo = ConstraintOperands[i]; // If this is an output operand with a matching input operand, look up the - // matching input. It might have a different type (e.g. the output might be - // i32 and the input i64) and we need to pick the larger width to ensure we - // reserve the right number of registers. + // matching input. If their types mismatch, e.g. one is an integer, the + // other is floating point, or their sizes are different, flag it as an + // error. if (OpInfo.hasMatchingInput()) { SDISelAsmOperandInfo &Input = ConstraintOperands[OpInfo.MatchingInput]; if (OpInfo.ConstraintVT != Input.ConstraintVT) { - assert(OpInfo.ConstraintVT.isInteger() && - Input.ConstraintVT.isInteger() && - "Asm constraints must be the same or different sized integers"); - if (OpInfo.ConstraintVT.getSizeInBits() < - Input.ConstraintVT.getSizeInBits()) - OpInfo.ConstraintVT = Input.ConstraintVT; - else - Input.ConstraintVT = OpInfo.ConstraintVT; + if ((OpInfo.ConstraintVT.isInteger() != + Input.ConstraintVT.isInteger()) || + (OpInfo.ConstraintVT.getSizeInBits() != + Input.ConstraintVT.getSizeInBits())) { + cerr << "Unsupported asm: input constraint with a matching output " + << "constraint of incompatible type!\n"; + exit(1); + } + Input.ConstraintVT = OpInfo.ConstraintVT; } } |

