summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/TargetInstrInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/TargetInstrInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetInstrInfo.cpp10
1 files changed, 7 insertions, 3 deletions
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;
OpenPOWER on IntegriCloud