From 570dd009c376cce18dd7f9a894854c4d4bd51b30 Mon Sep 17 00:00:00 2001 From: Philip Reames Date: Tue, 23 Aug 2016 21:21:43 +0000 Subject: [stackmaps] Extract out magic constants [NFCI] This is a first step towards clarifying the exact MI semantics of stackmap's "live values". llvm-svn: 279574 --- llvm/lib/CodeGen/TargetInstrInfo.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp') diff --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp index 78eb567daf8..3982e1e71d1 100644 --- a/llvm/lib/CodeGen/TargetInstrInfo.cpp +++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp @@ -437,11 +437,15 @@ static MachineInstr *foldPatchpoint(MachineFunction &MF, MachineInstr &MI, const TargetInstrInfo &TII) { unsigned StartIdx = 0; switch (MI.getOpcode()) { - case TargetOpcode::STACKMAP: - StartIdx = 2; // Skip ID, nShadowBytes. + case TargetOpcode::STACKMAP: { + // StackMapLiveValues are foldable + StackMapOpers opers(&MI); + StartIdx = opers.getVarIdx(); break; + } case TargetOpcode::PATCHPOINT: { - // For PatchPoint, the call args are not foldable. + // For PatchPoint, the call args are not foldable (even if reported in the + // stackmap e.g. via anyregcc). PatchPointOpers opers(&MI); StartIdx = opers.getVarIdx(); break; -- cgit v1.2.3