Commit 728e150e authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [compiler] Remove LoadStackPointer and related machinery

Port 5b2ab2f6

Original Commit Message:

    Now that all uses of LoadStackPointer have been removed, this CL cleans
    up related code:

    - Removed LoadStackPointer.
    - Removed ArchStackPointer.
    - Removed IA32StackCheck.
    - Removed X64StackCheck.
    - Removed StackCheckMatcher.

    All stack checks now follow a simple path without matchers or special
    register constraints: they load the limit and pass it to
    StackPointerGreaterThan, which is finally handled by code generation.

R=jgruber@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I68a66054dc1422e7fc0598ef4d112a031ba94cc1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1750223Reviewed-by: 's avatarMilad Farazmand <miladfar@ca.ibm.com>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#63184}
parent c4d31fea
...@@ -1114,10 +1114,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1114,10 +1114,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
AssembleReturn(instr->InputAt(0)); AssembleReturn(instr->InputAt(0));
DCHECK_EQ(LeaveRC, i.OutputRCBit()); DCHECK_EQ(LeaveRC, i.OutputRCBit());
break; break;
case kArchStackPointer:
__ mr(i.OutputRegister(), sp);
DCHECK_EQ(LeaveRC, i.OutputRCBit());
break;
case kArchFramePointer: case kArchFramePointer:
__ mr(i.OutputRegister(), fp); __ mr(i.OutputRegister(), fp);
DCHECK_EQ(LeaveRC, i.OutputRCBit()); DCHECK_EQ(LeaveRC, i.OutputRCBit());
......
...@@ -65,18 +65,6 @@ class PPCOperandGenerator final : public OperandGenerator { ...@@ -65,18 +65,6 @@ class PPCOperandGenerator final : public OperandGenerator {
} }
return false; return false;
} }
// Use the stack pointer if the node is LoadStackPointer, otherwise assign a
// register.
InstructionOperand UseRegisterOrStackPointer(Node* node) {
// TODO(miladfar): Remove this once LoadStackPointer has been removed.
if (node->opcode() == IrOpcode::kLoadStackPointer) {
return LocationOperand(LocationOperand::EXPLICIT,
LocationOperand::REGISTER,
MachineRepresentation::kWord32, sp.code());
}
return UseRegister(node);
}
}; };
namespace { namespace {
...@@ -1467,15 +1455,15 @@ void VisitWordCompare(InstructionSelector* selector, Node* node, ...@@ -1467,15 +1455,15 @@ void VisitWordCompare(InstructionSelector* selector, Node* node,
// Match immediates on left or right side of comparison. // Match immediates on left or right side of comparison.
if (g.CanBeImmediate(right, immediate_mode)) { if (g.CanBeImmediate(right, immediate_mode)) {
VisitCompare(selector, opcode, g.UseRegisterOrStackPointer(left), VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right),
g.UseImmediate(right), cont); cont);
} else if (g.CanBeImmediate(left, immediate_mode)) { } else if (g.CanBeImmediate(left, immediate_mode)) {
if (!commutative) cont->Commute(); if (!commutative) cont->Commute();
VisitCompare(selector, opcode, g.UseRegisterOrStackPointer(right), VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left),
g.UseImmediate(left), cont); cont);
} else { } else {
VisitCompare(selector, opcode, g.UseRegisterOrStackPointer(left), VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right),
g.UseRegisterOrStackPointer(right), cont); cont);
} }
} }
......
...@@ -1587,9 +1587,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction( ...@@ -1587,9 +1587,6 @@ CodeGenerator::CodeGenResult CodeGenerator::AssembleArchInstruction(
case kArchRet: case kArchRet:
AssembleReturn(instr->InputAt(0)); AssembleReturn(instr->InputAt(0));
break; break;
case kArchStackPointer:
__ LoadRR(i.OutputRegister(), sp);
break;
case kArchFramePointer: case kArchFramePointer:
__ LoadRR(i.OutputRegister(), fp); __ LoadRR(i.OutputRegister(), fp);
break; break;
......
...@@ -243,18 +243,6 @@ class S390OperandGenerator final : public OperandGenerator { ...@@ -243,18 +243,6 @@ class S390OperandGenerator final : public OperandGenerator {
bool Is64BitOperand(Node* node) { bool Is64BitOperand(Node* node) {
return MachineRepresentation::kWord64 == GetRepresentation(node); return MachineRepresentation::kWord64 == GetRepresentation(node);
} }
// Use the stack pointer if the node is LoadStackPointer, otherwise assign a
// register.
InstructionOperand UseRegisterOrStackPointer(Node* node) {
// TODO(miladfar): Remove this once LoadStackPointer has been removed.
if (node->opcode() == IrOpcode::kLoadStackPointer) {
return LocationOperand(LocationOperand::EXPLICIT,
LocationOperand::REGISTER,
MachineRepresentation::kWord32, sp.code());
}
return UseRegister(node);
}
}; };
namespace { namespace {
...@@ -1692,7 +1680,7 @@ void VisitWordCompare(InstructionSelector* selector, Node* node, ...@@ -1692,7 +1680,7 @@ void VisitWordCompare(InstructionSelector* selector, Node* node,
return VisitLoadAndTest(selector, load_and_test, node, left, cont, true); return VisitLoadAndTest(selector, load_and_test, node, left, cont, true);
} }
inputs[input_count++] = g.UseRegisterOrStackPointer(left); inputs[input_count++] = g.UseRegister(left);
if (g.CanBeMemoryOperand(opcode, node, right, effect_level)) { if (g.CanBeMemoryOperand(opcode, node, right, effect_level)) {
// generate memory operand // generate memory operand
AddressingMode addressing_mode = g.GetEffectiveAddressMemoryOperand( AddressingMode addressing_mode = g.GetEffectiveAddressMemoryOperand(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment