Commit 5c5a6214 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[turbofan] address nits for "[turbofan] Masking/poisoning in codegen (optimized code, x64)"

https://chromium-review.googlesource.com/c/v8/v8/+/901625 was committed without the nits addressed. This addresses the outstanding comments.

Change-Id: Ibefca64ddcfddf1d6c4138647434af331c18a801
Reviewed-on: https://chromium-review.googlesource.com/918762Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51289}
parent 972f5d4b
......@@ -141,8 +141,6 @@ void CodeGenerator::AssembleCode() {
// the frame (that is done in AssemblePrologue).
FrameScope frame_scope(tasm(), StackFrame::MANUAL);
InitializePoisonForLoadsIfNeeded();
if (info->is_source_positions_enabled()) {
AssembleSourcePosition(start_source_position());
}
......@@ -160,6 +158,8 @@ void CodeGenerator::AssembleCode() {
if (info->is_speculation_poison_enabled()) {
GenerateSpeculationPoison();
} else {
InitializePoisonForLoadsIfNeeded();
}
// TODO(jupvfranco): This should be the first thing in the code after
......
......@@ -1005,6 +1005,7 @@ void InstructionSelector::VisitControl(BasicBlock* block) {
return VisitTailCall(input);
}
case BasicBlock::kBranch: {
DCHECK_EQ(IrOpcode::kBranch, input->opcode());
BasicBlock* tbranch = block->SuccessorAt(0);
BasicBlock* fbranch = block->SuccessorAt(1);
if (tbranch == fbranch) return VisitGoto(tbranch);
......
......@@ -41,6 +41,7 @@ struct PushParameter {
};
enum class FrameStateInputKind { kAny, kStackSlot };
// Instruction selection generates an InstructionSequence for a given Schedule.
class V8_EXPORT_PRIVATE InstructionSelector final {
public:
......
......@@ -123,11 +123,12 @@ bool JumpThreading::ComputeForwarding(Zone* local_zone,
fallthru = false;
}
break;
}
if (fallthru) {
int next = 1 + block->rpo_number().ToInt();
if (next < code->InstructionBlockCount()) fw = RpoNumber::FromInt(next);
}
}
if (fallthru) {
int next = 1 + block->rpo_number().ToInt();
if (next < code->InstructionBlockCount())
fw = RpoNumber::FromInt(next);
}
}
state.Forward(fw);
}
......
......@@ -2207,7 +2207,6 @@ bool PipelineImpl::SelectInstructions(Linkage* linkage) {
AllocateRegisters(config.get(), call_descriptor, run_verifier);
} else if (data->info()->is_poison_loads()) {
CHECK(InstructionSelector::SupportsSpeculationPoisoning());
CHECK_NE(kSpeculationPoisonRegister, Register::no_reg());
AllocateRegisters(RegisterConfiguration::Poisoning(), call_descriptor,
run_verifier);
} else {
......
......@@ -268,7 +268,7 @@ void Verifier::Visitor::Check(Node* node, const AllNodes& all) {
case IrOpcode::kIfTrue:
case IrOpcode::kIfFalse: {
Node* control = NodeProperties::GetControlInput(node, 0);
CHECK(control->opcode() == IrOpcode::kBranch);
CHECK_EQ(IrOpcode::kBranch, control->opcode());
// Type is empty.
CheckNotTyped(node);
break;
......
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