[llvm] r297413 - GlobalISel: inform FrameLowering when we emit a function call.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 9 14:00:39 PST 2017
Author: tnorthover
Date: Thu Mar 9 16:00:39 2017
New Revision: 297413
URL: http://llvm.org/viewvc/llvm-project?rev=297413&view=rev
Log:
GlobalISel: inform FrameLowering when we emit a function call.
Amongst other things (I expect) this is necessary to ensure decent backtraces
when an "unreachable" is involved.
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/call-translator.ll
llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-pow.mir
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=297413&r1=297412&r2=297413&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Thu Mar 9 16:00:39 2017
@@ -729,6 +729,7 @@ bool IRTranslator::translateCall(const U
for (auto &Arg: CI.arg_operands())
Args.push_back(getOrCreateVReg(*Arg));
+ MF->getFrameInfo().setHasCalls(true);
return CLI->lowerCall(MIRBuilder, CI, Res, Args, [&]() {
return getOrCreateVReg(*CI.getCalledValue());
});
Modified: llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp?rev=297413&r1=297412&r2=297413&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/LegalizerHelper.cpp Thu Mar 9 16:00:39 2017
@@ -117,6 +117,7 @@ LegalizerHelper::libcall(MachineInstr &M
auto &CLI = *MIRBuilder.getMF().getSubtarget().getCallLowering();
auto &TLI = *MIRBuilder.getMF().getSubtarget().getTargetLowering();
const char *Name = TLI.getLibcallName(getRTLibDesc(MI.getOpcode(), Size));
+ MIRBuilder.getMF().getFrameInfo().setHasCalls(true);
CLI.lowerCall(
MIRBuilder, MachineOperand::CreateES(Name),
{MI.getOperand(0).getReg(), Ty},
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/call-translator.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/call-translator.ll?rev=297413&r1=297412&r2=297413&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/call-translator.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/call-translator.ll Thu Mar 9 16:00:39 2017
@@ -96,6 +96,7 @@ define {double, i64, i32} @test_struct_r
}
; CHECK-LABEL: name: test_arr_call
+; CHECK: hasCalls: true
; CHECK: [[ARG:%[0-9]+]](s256) = G_LOAD
; CHECK: [[E0:%[0-9]+]](s64) = G_EXTRACT [[ARG]](s256), 0
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-pow.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-pow.mir?rev=297413&r1=297412&r2=297413&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-pow.mir (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-pow.mir Thu Mar 9 16:00:39 2017
@@ -15,6 +15,9 @@ body: |
bb.0.entry:
liveins: %d0, %d1, %s2, %s3
+ ; CHECK-LABEL: name: test_pow
+ ; CHECK: hasCalls: true
+
%0:_(s64) = COPY %d0
%1:_(s64) = COPY %d1
%2:_(s32) = COPY %s2
More information about the llvm-commits
mailing list