[llvm-commits] [llvm] r164662 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll
Bill Wendling
wendling at apple.com
Fri Sep 28 13:21:54 PDT 2012
On Sep 27, 2012, at 3:38 PM, Eric Christopher <echristo at gmail.com> wrote:
>> if (NumParts == 1) {
>> - assert(PartVT == ValueVT && "Type conversion failed!");
>> + if (PartVT != ValueVT) {
>> + LLVMContext &Ctx = *DAG.getContext();
>> + Twine ErrMsg("scalar-to-vector conversion failed");
>> + if (const Instruction *I = dyn_cast_or_null<Instruction>(V)) {
>> + if (const CallInst *CI = dyn_cast<CallInst>(I))
>> + if (isa<InlineAsm>(CI->getCalledValue()))
>> + ErrMsg = ErrMsg + ", possible invalid constraint for vector type";
>> + Ctx.emitError(I, ErrMsg);
>
> For this part we probably want to diagnose this in the front end, since we
> have access to the constraint and the type coming in. No objections
> to having some information here either, but it's definitely not an ideal
> location. Maybe even a verifier on IR instead that determines that
> we'd fail rather than having to go through codegen for it. It couldn't catch
> cases that are only visibile via optimization, but those should be a
> relatively small sample size.
>
Where in the front-end do you think this should go? It may be a bit too much information for the front-end to have to know -- that it's a vector and that these specific scalar-to-vector conversions are wrong...
-bw
More information about the llvm-commits
mailing list