OSDN Git Service

[Stackmaps] Fix the ID type to be i64 also for stackmaps (as we claim in the documena...
authorJuergen Ributzka <juergen@apple.com>
Wed, 12 Feb 2014 22:17:10 +0000 (22:17 +0000)
committerJuergen Ributzka <juergen@apple.com>
Wed, 12 Feb 2014 22:17:10 +0000 (22:17 +0000)
The ID type for the stackmap and patchpoint intrinsics are in both cases i64.
This fixes an zero extend in the SelectionDAGBuilder that still used i32. This
also updates the target independent instructions STACKMAP and PATCHPOINT to use
the correct type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201262 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/Target.td
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

index fb3e764..55b65d0 100644 (file)
@@ -814,14 +814,14 @@ def LIFETIME_END : Instruction {
 }
 def STACKMAP : Instruction {
   let OutOperandList = (outs);
-  let InOperandList = (ins i32imm:$id, i32imm:$nbytes, variable_ops);
+  let InOperandList = (ins i64imm:$id, i32imm:$nbytes, variable_ops);
   let isCall = 1;
   let mayLoad = 1;
   let usesCustomInserter = 1;
 }
 def PATCHPOINT : Instruction {
   let OutOperandList = (outs unknown:$dst);
-  let InOperandList = (ins i32imm:$id, i32imm:$nbytes, unknown:$callee,
+  let InOperandList = (ins i64imm:$id, i32imm:$nbytes, unknown:$callee,
                        i32imm:$nargs, i32imm:$cc, variable_ops);
   let isCall = 1;
   let mayLoad = 1;
index bf52579..4d3684c 100644 (file)
@@ -6917,12 +6917,13 @@ void SelectionDAGBuilder::visitStackmap(const CallInst &CI) {
   // Replace the target specific call node with the stackmap intrinsic.
   SmallVector<SDValue, 8> Ops;
 
-  // Add the <id> and <numShadowBytes> constants.
-  for (unsigned i = 0; i < 2; ++i) {
-    SDValue tmp = getValue(CI.getOperand(i));
-    Ops.push_back(DAG.getTargetConstant(
-        cast<ConstantSDNode>(tmp)->getZExtValue(), MVT::i32));
-  }
+  // Add the <id> and <numBytes> constants.
+  SDValue IDVal = getValue(CI.getOperand(PatchPointOpers::IDPos));
+  Ops.push_back(DAG.getTargetConstant(
+                  cast<ConstantSDNode>(IDVal)->getZExtValue(), MVT::i64));
+  SDValue NBytesVal = getValue(CI.getOperand(PatchPointOpers::NBytesPos));
+  Ops.push_back(DAG.getTargetConstant(
+                  cast<ConstantSDNode>(NBytesVal)->getZExtValue(), MVT::i32));
   // Push live variables for the stack map.
   addStackMapLiveVars(CI, 2, Ops, *this);