summaryrefslogtreecommitdiffstats
path: root/compiler/optimizing/instruction_simplifier.cc
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2017-12-14 16:46:34 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-12-14 16:46:34 +0000
commitba3a790338725a37ecd4cb314c4a6147e29aef38 (patch)
treef81b0225fa22d02e9726c743d486d314cde91893 /compiler/optimizing/instruction_simplifier.cc
parentdf6e7fa50734cd052c34e28128a6d2d398790072 (diff)
parent04366f382239f4bcf1f9c67bb1ff6975607cd8e4 (diff)
downloadart-ba3a790338725a37ecd4cb314c4a6147e29aef38.tar.gz
art-ba3a790338725a37ecd4cb314c4a6147e29aef38.tar.bz2
art-ba3a790338725a37ecd4cb314c4a6147e29aef38.zip
Merge "Revert "ART: Try to statically evaluate some conditions.""
Diffstat (limited to 'compiler/optimizing/instruction_simplifier.cc')
-rw-r--r--compiler/optimizing/instruction_simplifier.cc21
1 files changed, 0 insertions, 21 deletions
diff --git a/compiler/optimizing/instruction_simplifier.cc b/compiler/optimizing/instruction_simplifier.cc
index 53e449bbbe..a42a85dc1d 100644
--- a/compiler/optimizing/instruction_simplifier.cc
+++ b/compiler/optimizing/instruction_simplifier.cc
@@ -994,27 +994,6 @@ void InstructionSimplifierVisitor::VisitIf(HIf* instruction) {
instruction->GetBlock()->SwapSuccessors();
RecordSimplification();
}
- HInstruction* input = instruction->InputAt(0);
-
- // If a condition 'cond' is evaluated in an HIf instruction then in the successors of the
- // IF_BLOCK we statically know the value of the condition (TRUE in TRUE_SUCC, FALSE in
- // FALSE_SUCC). Using that we can replace another evaluation (use) EVAL of the same 'cond'
- // with TRUE value (FALSE value) if every path from the ENTRY_BLOCK to EVAL_BLOCK contains the
- // edge HIF_BLOCK->TRUE_SUCC (HIF_BLOCK->FALSE_SUCC).
- if (!input->IsConstant()) {
- HBasicBlock* true_succ = instruction->IfTrueSuccessor();
- HBasicBlock* false_succ = instruction->IfFalseSuccessor();
-
- DCHECK_EQ(true_succ->GetPredecessors().size(), 1u);
- input->ReplaceUsesDominatedBy(
- true_succ->GetFirstInstruction(), GetGraph()->GetIntConstant(1), /* strictly */ false);
- RecordSimplification();
-
- DCHECK_EQ(false_succ->GetPredecessors().size(), 1u);
- input->ReplaceUsesDominatedBy(
- false_succ->GetFirstInstruction(), GetGraph()->GetIntConstant(0), /* strictly */ false);
- RecordSimplification();
- }
}
void InstructionSimplifierVisitor::VisitArrayLength(HArrayLength* instruction) {