diff --git a/src/compiler/machine-operator.cc b/src/compiler/machine-operator.cc index ae690b3e0f..78925ec8f9 100644 --- a/src/compiler/machine-operator.cc +++ b/src/compiler/machine-operator.cc @@ -617,56 +617,52 @@ struct MachineOperatorGlobalCache { OVERFLOW_OP_LIST(OVERFLOW_OP) #undef OVERFLOW_OP -#define LOAD(Type) \ - struct Load##Type##Operator final : public Operator1 { \ - Load##Type##Operator() \ - : Operator1( \ - IrOpcode::kLoad, \ - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ - "Load", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ - }; \ - struct PoisonedLoad##Type##Operator final \ - : public Operator1 { \ - PoisonedLoad##Type##Operator() \ - : Operator1( \ - IrOpcode::kPoisonedLoad, \ - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ - "PoisonedLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ - }; \ - struct UnalignedLoad##Type##Operator final \ - : public Operator1 { \ - UnalignedLoad##Type##Operator() \ - : Operator1( \ - IrOpcode::kUnalignedLoad, \ - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ - "UnalignedLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ - }; \ - struct ProtectedLoad##Type##Operator final \ - : public Operator1 { \ - ProtectedLoad##Type##Operator() \ - : Operator1( \ - IrOpcode::kProtectedLoad, \ - Operator::kNoDeopt | Operator::kNoThrow, "ProtectedLoad", 2, 1, \ - 1, 1, 1, 0, MachineType::Type()) {} \ - }; \ - Load##Type##Operator kLoad##Type; \ - PoisonedLoad##Type##Operator kPoisonedLoad##Type; \ - UnalignedLoad##Type##Operator kUnalignedLoad##Type; \ +#define LOAD(Type) \ + struct Load##Type##Operator final : public Operator1 { \ + Load##Type##Operator() \ + : Operator1(IrOpcode::kLoad, \ + Operator::kEliminatable, "Load", 2, 1, \ + 1, 1, 1, 0, MachineType::Type()) {} \ + }; \ + struct PoisonedLoad##Type##Operator final \ + : public Operator1 { \ + PoisonedLoad##Type##Operator() \ + : Operator1( \ + IrOpcode::kPoisonedLoad, Operator::kEliminatable, \ + "PoisonedLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ + }; \ + struct UnalignedLoad##Type##Operator final \ + : public Operator1 { \ + UnalignedLoad##Type##Operator() \ + : Operator1( \ + IrOpcode::kUnalignedLoad, Operator::kEliminatable, \ + "UnalignedLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ + }; \ + struct ProtectedLoad##Type##Operator final \ + : public Operator1 { \ + ProtectedLoad##Type##Operator() \ + : Operator1( \ + IrOpcode::kProtectedLoad, \ + Operator::kNoDeopt | Operator::kNoThrow, "ProtectedLoad", 2, 1, \ + 1, 1, 1, 0, MachineType::Type()) {} \ + }; \ + Load##Type##Operator kLoad##Type; \ + PoisonedLoad##Type##Operator kPoisonedLoad##Type; \ + UnalignedLoad##Type##Operator kUnalignedLoad##Type; \ ProtectedLoad##Type##Operator kProtectedLoad##Type; MACHINE_TYPE_LIST(LOAD) #undef LOAD -#define LOAD_TRANSFORM_KIND(TYPE, KIND) \ - struct KIND##LoadTransform##TYPE##Operator final \ - : public Operator1 { \ - KIND##LoadTransform##TYPE##Operator() \ - : Operator1( \ - IrOpcode::kLoadTransform, \ - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ - #KIND "LoadTransform", 2, 1, 1, 1, 1, 0, \ - LoadTransformParameters{LoadKind::k##KIND, \ - LoadTransformation::k##TYPE}) {} \ - }; \ +#define LOAD_TRANSFORM_KIND(TYPE, KIND) \ + struct KIND##LoadTransform##TYPE##Operator final \ + : public Operator1 { \ + KIND##LoadTransform##TYPE##Operator() \ + : Operator1( \ + IrOpcode::kLoadTransform, Operator::kEliminatable, \ + #KIND "LoadTransform", 2, 1, 1, 1, 1, 0, \ + LoadTransformParameters{LoadKind::k##KIND, \ + LoadTransformation::k##TYPE}) {} \ + }; \ KIND##LoadTransform##TYPE##Operator k##KIND##LoadTransform##TYPE; #define LOAD_TRANSFORM(TYPE) \ @@ -767,8 +763,7 @@ struct MachineOperatorGlobalCache { : public Operator1 { \ Word32AtomicLoad##Type##Operator() \ : Operator1( \ - IrOpcode::kWord32AtomicLoad, \ - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ + IrOpcode::kWord32AtomicLoad, Operator::kEliminatable, \ "Word32AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ }; \ Word32AtomicLoad##Type##Operator kWord32AtomicLoad##Type; @@ -780,8 +775,7 @@ struct MachineOperatorGlobalCache { : public Operator1 { \ Word64AtomicLoad##Type##Operator() \ : Operator1( \ - IrOpcode::kWord64AtomicLoad, \ - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, \ + IrOpcode::kWord64AtomicLoad, Operator::kEliminatable, \ "Word64AtomicLoad", 2, 1, 1, 1, 1, 0, MachineType::Type()) {} \ }; \ Word64AtomicLoad##Type##Operator kWord64AtomicLoad##Type; diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc index 3a219a6ce9..edcc449879 100644 --- a/src/compiler/simplified-operator.cc +++ b/src/compiler/simplified-operator.cc @@ -854,16 +854,14 @@ struct SimplifiedOperatorGlobalCache final { PURE_OP_LIST(PURE) #undef PURE -#define EFFECT_DEPENDENT(Name, properties, value_input_count, \ - control_input_count) \ - struct Name##Operator final : public Operator { \ - Name##Operator() \ - : Operator(IrOpcode::k##Name, \ - Operator::kNoDeopt | Operator::kNoWrite | \ - Operator::kNoThrow | properties, \ - #Name, value_input_count, 1, control_input_count, 1, 1, \ - 0) {} \ - }; \ +#define EFFECT_DEPENDENT(Name, properties, value_input_count, \ + control_input_count) \ + struct Name##Operator final : public Operator { \ + Name##Operator() \ + : Operator(IrOpcode::k##Name, Operator::kEliminatable | properties, \ + #Name, value_input_count, 1, control_input_count, 1, 1, \ + 0) {} \ + }; \ Name##Operator k##Name; EFFECT_DEPENDENT_OP_LIST(EFFECT_DEPENDENT) #undef EFFECT_DEPENDENT @@ -1129,10 +1127,9 @@ struct SimplifiedOperatorGlobalCache final { LoadStackArgumentOperator() : Operator( // -- IrOpcode::kLoadStackArgument, // opcode - Operator::kNoDeopt | Operator::kNoThrow | - Operator::kNoWrite, // flags - "LoadStackArgument", // name - 2, 1, 1, 1, 1, 0) {} // counts + Operator::kEliminatable, // flags + "LoadStackArgument", // name + 2, 1, 1, 1, 1, 0) {} // counts }; LoadStackArgumentOperator kLoadStackArgument; @@ -1730,9 +1727,8 @@ bool operator==(FastApiCallParameters const& lhs, const Operator* SimplifiedOperatorBuilder::Allocate(Type type, AllocationType allocation) { return new (zone()) Operator1( - IrOpcode::kAllocate, - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, "Allocate", - 1, 1, 1, 1, 1, 0, AllocateParameters(type, allocation)); + IrOpcode::kAllocate, Operator::kEliminatable, "Allocate", 1, 1, 1, 1, 1, + 0, AllocateParameters(type, allocation)); } const Operator* SimplifiedOperatorBuilder::AllocateRaw( @@ -1744,10 +1740,8 @@ const Operator* SimplifiedOperatorBuilder::AllocateRaw( allocation == AllocationType::kYoung && !FLAG_young_generation_large_objects)); return new (zone()) Operator1( - IrOpcode::kAllocateRaw, - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, - "AllocateRaw", 1, 1, 1, 1, 1, 1, - AllocateParameters(type, allocation, allow_large_objects)); + IrOpcode::kAllocateRaw, Operator::kEliminatable, "AllocateRaw", 1, 1, 1, + 1, 1, 1, AllocateParameters(type, allocation, allow_large_objects)); } #define SPECULATIVE_NUMBER_BINOP(Name) \ @@ -1795,10 +1789,8 @@ ACCESS_OP_LIST(ACCESS) #undef ACCESS const Operator* SimplifiedOperatorBuilder::LoadMessage() { - return new (zone()) - Operator(IrOpcode::kLoadMessage, - Operator::kNoDeopt | Operator::kNoThrow | Operator::kNoWrite, - "LoadMessage", 1, 1, 1, 1, 1, 0); + return new (zone()) Operator(IrOpcode::kLoadMessage, Operator::kEliminatable, + "LoadMessage", 1, 1, 1, 1, 1, 0); } const Operator* SimplifiedOperatorBuilder::StoreMessage() {