summaryrefslogtreecommitdiff
path: root/compiler/optimizing/instruction_simplifier.cc
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2023-11-15 15:21:12 +0000
committer Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-12-06 20:13:28 +0000
commitc60b6f7754974809f7467a07d63475248274026b (patch)
treefda79143856a9c6442c81acf81278600e42e8ada /compiler/optimizing/instruction_simplifier.cc
parent52eb30a5d4783ee0069697af654f935cc35d3e4f (diff)
Remove partial LSE
It has been disabled for a while and it has bit rotted Bug: 298176183 Test: art/test/testrunner/testrunner.py --host --64 -b --optimizing Test: m test-art-host-gtest-art_compiler_tests64 Change-Id: I4fcd8b3d18a3388e078b5cb3c340b2e270aefef7
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r--compiler/optimizing/instruction_simplifier.cc65
1 files changed, 0 insertions, 65 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index 3328f3babe..94b201e876 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -115,7 +115,6 @@ class InstructionSimplifierVisitor final : public HGraphDelegateVisitor {
void VisitInvoke(HInvoke* invoke) override;
void VisitDeoptimize(HDeoptimize* deoptimize) override;
void VisitVecMul(HVecMul* instruction) override;
- void VisitPredicatedInstanceFieldGet(HPredicatedInstanceFieldGet* instruction) override;
void SimplifyBoxUnbox(HInvoke* instruction, ArtField* field, DataType::Type type);
void SimplifySystemArrayCopy(HInvoke* invoke);
void SimplifyStringEquals(HInvoke* invoke);
@@ -950,67 +949,6 @@ static HInstruction* AllowInMinMax(IfCondition cmp,
return nullptr;
}
-// TODO This should really be done by LSE itself since there is significantly
-// more information available there.
-void InstructionSimplifierVisitor::VisitPredicatedInstanceFieldGet(
- HPredicatedInstanceFieldGet* pred_get) {
- HInstruction* target = pred_get->GetTarget();
- HInstruction* default_val = pred_get->GetDefaultValue();
- if (target->IsNullConstant()) {
- pred_get->ReplaceWith(default_val);
- pred_get->GetBlock()->RemoveInstruction(pred_get);
- RecordSimplification();
- return;
- } else if (!target->CanBeNull()) {
- HInstruction* replace_with = new (GetGraph()->GetAllocator())
- HInstanceFieldGet(pred_get->GetTarget(),
- pred_get->GetFieldInfo().GetField(),
- pred_get->GetFieldType(),
- pred_get->GetFieldOffset(),
- pred_get->IsVolatile(),
- pred_get->GetFieldInfo().GetFieldIndex(),
- pred_get->GetFieldInfo().GetDeclaringClassDefIndex(),
- pred_get->GetFieldInfo().GetDexFile(),
- pred_get->GetDexPc());
- if (pred_get->GetType() == DataType::Type::kReference) {
- replace_with->SetReferenceTypeInfoIfValid(pred_get->GetReferenceTypeInfo());
- }
- pred_get->GetBlock()->InsertInstructionBefore(replace_with, pred_get);
- pred_get->ReplaceWith(replace_with);
- pred_get->GetBlock()->RemoveInstruction(pred_get);
- RecordSimplification();
- return;
- }
- if (!target->IsPhi() || !default_val->IsPhi() || default_val->GetBlock() != target->GetBlock()) {
- // The iget has already been reduced. We know the target or the phi
- // selection will differ between the target and default.
- return;
- }
- DCHECK_EQ(default_val->InputCount(), target->InputCount());
- // In the same block both phis only one non-null we can remove the phi from default_val.
- HInstruction* single_value = nullptr;
- auto inputs = target->GetInputs();
- for (auto [input, idx] : ZipCount(MakeIterationRange(inputs))) {
- if (input->CanBeNull()) {
- if (single_value == nullptr) {
- single_value = default_val->InputAt(idx);
- } else if (single_value != default_val->InputAt(idx) &&
- !single_value->Equals(default_val->InputAt(idx))) {
- // Multiple values are associated with potential nulls, can't combine.
- return;
- }
- }
- }
- DCHECK(single_value != nullptr) << "All target values are non-null but the phi as a whole still"
- << " can be null? This should not be possible." << std::endl
- << pred_get->DumpWithArgs();
- if (single_value->StrictlyDominates(pred_get)) {
- // Combine all the maybe null values into one.
- pred_get->ReplaceInput(single_value, 0);
- RecordSimplification();
- }
-}
-
void InstructionSimplifierVisitor::VisitSelect(HSelect* select) {
HInstruction* replace_with = nullptr;
HInstruction* condition = select->GetCondition();
@@ -1234,9 +1172,6 @@ static inline bool TryReplaceFieldOrArrayGetType(HInstruction* maybe_get, DataTy
if (maybe_get->IsInstanceFieldGet()) {
maybe_get->AsInstanceFieldGet()->SetType(new_type);
return true;
- } else if (maybe_get->IsPredicatedInstanceFieldGet()) {
- maybe_get->AsPredicatedInstanceFieldGet()->SetType(new_type);
- return true;
} else if (maybe_get->IsStaticFieldGet()) {
maybe_get->AsStaticFieldGet()->SetType(new_type);
return true;