mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-19 06:31:18 +00:00
Avoid storing Twines.
While there nested ifs into a helper function. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7563821402
commit
70c25ab51b
@ -214,6 +214,20 @@ static SDValue getCopyFromParts(SelectionDAG &DAG, SDLoc DL,
|
||||
llvm_unreachable("Unknown mismatch!");
|
||||
}
|
||||
|
||||
static void diagnosePossiblyInvalidConstraint(LLVMContext &Ctx, const Value *V,
|
||||
const Twine &ErrMsg) {
|
||||
const Instruction *I = dyn_cast_or_null<Instruction>(V);
|
||||
if (!V)
|
||||
return Ctx.emitError(ErrMsg);
|
||||
|
||||
const char *AsmError = ", possible invalid constraint for vector type";
|
||||
if (const CallInst *CI = dyn_cast<CallInst>(I))
|
||||
if (isa<InlineAsm>(CI->getCalledValue()))
|
||||
return Ctx.emitError(I, ErrMsg + AsmError);
|
||||
|
||||
return Ctx.emitError(I, ErrMsg);
|
||||
}
|
||||
|
||||
/// getCopyFromPartsVector - Create a value that contains the specified legal
|
||||
/// parts combined into the value they represent. If the parts combine to a
|
||||
/// type larger then ValueVT then AssertOp can be used to specify whether the
|
||||
@ -306,16 +320,8 @@ static SDValue getCopyFromPartsVector(SelectionDAG &DAG, SDLoc DL,
|
||||
|
||||
// Handle cases such as i8 -> <1 x i1>
|
||||
if (ValueVT.getVectorNumElements() != 1) {
|
||||
LLVMContext &Ctx = *DAG.getContext();
|
||||
Twine ErrMsg("non-trivial scalar-to-vector conversion");
|
||||
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);
|
||||
} else {
|
||||
Ctx.emitError(ErrMsg);
|
||||
}
|
||||
diagnosePossiblyInvalidConstraint(*DAG.getContext(), V,
|
||||
"non-trivial scalar-to-vector conversion");
|
||||
return DAG.getUNDEF(ValueVT);
|
||||
}
|
||||
|
||||
@ -397,18 +403,9 @@ static void getCopyToParts(SelectionDAG &DAG, SDLoc DL,
|
||||
"Failed to tile the value with PartVT!");
|
||||
|
||||
if (NumParts == 1) {
|
||||
if (PartEVT != 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);
|
||||
} else {
|
||||
Ctx.emitError(ErrMsg);
|
||||
}
|
||||
}
|
||||
if (PartEVT != ValueVT)
|
||||
diagnosePossiblyInvalidConstraint(*DAG.getContext(), V,
|
||||
"scalar-to-vector conversion failed");
|
||||
|
||||
Parts[0] = Val;
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user