diff --git a/lib/CodeGen/GlobalISel/IRTranslator.cpp b/lib/CodeGen/GlobalISel/IRTranslator.cpp index a1a1d7b9fb5..eee78ea8cbc 100644 --- a/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -579,6 +579,10 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID, MIRBuilder.buildDirectDbgValue(Reg, DI.getVariable(), DI.getExpression()); return true; } + case Intrinsic::vaend: + // No target I know of cares about va_end. Certainly no in-tree target + // does. Simplest intrinsic ever! + return true; case Intrinsic::dbg_value: { // This form of DBG_VALUE is target-independent. const DbgValueInst &DI = cast(CI); diff --git a/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll b/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll index bac3017a925..943a57f55cb 100644 --- a/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll +++ b/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll @@ -1123,3 +1123,13 @@ define i8* @test_const_placement() { next: ret i8* inttoptr(i32 42 to i8*) } + +declare void @llvm.va_end(i8*) +define void @test_va_end(i8* %list) { +; CHECK-LABEL: name: test_va_end +; CHECK-NOT: va_end +; CHECK-NOT: INTRINSIC +; CHECK: RET_ReallyLR + call void @llvm.va_end(i8* %list) + ret void +}