[GlobalISel][InlineAsm] Fix matching input constraints to mem operand

Mark matching input constraint to mem operand as not supported.

Differential Revision: https://reviews.llvm.org/D83235
This commit is contained in:
Petar Avramovic 2020-07-08 12:32:17 +02:00
parent 75f9aa6ce0
commit 419c92a749
2 changed files with 22 additions and 0 deletions

View File

@ -406,6 +406,18 @@ bool InlineAsmLowering::lowerInlineAsm(
InstFlagIdx += getNumOpRegs(*Inst, InstFlagIdx) + 1;
assert(getNumOpRegs(*Inst, InstFlagIdx) == 1 && "Wrong flag");
unsigned MatchedOperandFlag = Inst->getOperand(InstFlagIdx).getImm();
if (InlineAsm::isMemKind(MatchedOperandFlag)) {
LLVM_DEBUG(dbgs() << "Matching input constraint to mem operand not "
"supported. This should be target specific.\n");
return false;
}
if (!InlineAsm::isRegDefKind(MatchedOperandFlag) &&
!InlineAsm::isRegDefEarlyClobberKind(MatchedOperandFlag)) {
LLVM_DEBUG(dbgs() << "Unknown matching constraint\n");
return false;
}
// We want to tie input to register in next operand.
unsigned DefRegIdx = InstFlagIdx + 1;
Register Def = Inst->getOperand(DefRegIdx).getReg();

View File

@ -244,6 +244,16 @@ define i8 @scalable_call(i8* %addr) #1 {
ret i8 %res
}
; FALLBACK-WITH-REPORT-ERR: remark: <unknown>:0:0: unable to translate instruction{{.*}}asm_indirect_output
; FALLBACK-WITH-REPORT-OUT-LABEL: asm_indirect_output
define void @asm_indirect_output() {
entry:
%ap = alloca i8*, align 8
%0 = load i8*, i8** %ap, align 8
call void asm sideeffect "", "=*r|m,0,~{memory}"(i8** %ap, i8* %0)
ret void
}
attributes #1 = { "target-features"="+sve" }
declare <vscale x 16 x i1> @llvm.aarch64.sve.ptrue.nxv16i1(i32 %pattern)