[llvm-commits] [llvm] r164662 - in /llvm/trunk: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll

Eric Christopher echristo at gmail.com
Thu Sep 27 15:38:17 PDT 2012


> Added:
>     llvm/trunk/test/CodeGen/ARM/2012-09-25-InlineAsmScalarToVectorConv2.ll

No need to do the date thing anymore.

> Modified:
>     llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
>


>    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.

-eric



More information about the llvm-commits mailing list