diff --git a/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp b/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp --- a/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InlineAsmLowering.cpp @@ -306,6 +306,12 @@ // Compute the constraint code and ConstraintType to use. computeConstraintToUse(TLI, OpInfo); + if (OpInfo.ConstraintType == TargetLowering::C_Memory && + !OpInfo.isIndirect) { + LLVM_DEBUG(dbgs() << "Cannot indirectify memory input operands yet\n"); + return false; + } + // The selected constraint type might expose new sideeffects ExtraInfo.update(OpInfo); } diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll --- a/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll +++ b/llvm/test/CodeGen/AArch64/GlobalISel/arm64-fallback.ll @@ -210,3 +210,12 @@ } attributes #0 = { "target-features"="+strict-align" } + +; FALLBACK-WITH-REPORT-ERR: remark: :0:0: unable to translate instruction: call +; FALLBACK-WITH-REPORT-ERR: warning: Instruction selection used fallback path for direct_mem +; FALLBACK-WITH-REPORT-OUT-LABEL: direct_mem +define void @direct_mem(i32 %x, i32 %y) { +entry: + tail call void asm sideeffect "", "imr,imr,~{memory}"(i32 %x, i32 %y) + ret void +}