Commit d3640534 by Jeff Law Committed by Jeff Law

re PR tree-optimization/88797 (Unneeded branch added when function is inlined…

re PR tree-optimization/88797 (Unneeded branch added when function is inlined (function runs faster if not inlined))

	PR tree-optimization/88797
	* gimple-ssa-split-paths (is_feasible_trace): Reject cases where the
	PHI feeds a conditional on the RHS of an assignment.

	PR tree-optimization/88797
	* g++.dg/tree-ssa/pr88797.C: New test.

From-SVN: r270775
parent 7ee7c293
2019-05-01 Jeff Law <law@redhat.com>
PR tree-optimization/88797
* gimple-ssa-split-paths (is_feasible_trace): Reject cases where the
PHI feeds a conditional on the RHS of an assignment.
2019-04-30 Andrew Waterman <andrew@sifive.com> 2019-04-30 Andrew Waterman <andrew@sifive.com>
Jim Wilson <jimw@sifive.com> Jim Wilson <jimw@sifive.com>
......
...@@ -264,8 +264,12 @@ is_feasible_trace (basic_block bb) ...@@ -264,8 +264,12 @@ is_feasible_trace (basic_block bb)
if (is_gimple_debug (stmt)) if (is_gimple_debug (stmt))
continue; continue;
/* If there's a use in the joiner this might be a CSE/DCE /* If there's a use in the joiner this might be a CSE/DCE
opportunity. */ opportunity, but not if the use is in a conditional
if (gimple_bb (stmt) == bb) which makes this a likely if-conversion candidate. */
if (gimple_bb (stmt) == bb
&& (!is_gimple_assign (stmt)
|| (TREE_CODE_CLASS (gimple_assign_rhs_code (stmt))
!= tcc_comparison)))
{ {
found_useful_phi = true; found_useful_phi = true;
break; break;
......
2019-05-01 Jeff Law <law@redhat.com>
PR tree-optimization/90037
* g++.dg/tree-ssa/pr88797.C: New test.
2019-05-01 Nathan Sidwell <nathan@acm.org> 2019-05-01 Nathan Sidwell <nathan@acm.org>
* g++.dg/cpp0x/decltype9.C: Adjust expected diagnostics. * g++.dg/cpp0x/decltype9.C: Adjust expected diagnostics.
......
/* { dg-do compile } */
/* { dg-options "-O3 -fdump-tree-split-paths-details" } */
void use(unsigned);
bool f(unsigned x, unsigned y) {
return x < 1111 + (y <= 2222);
}
void test_f(unsigned x, unsigned y) {
for (unsigned i = 0; i < 3333; ++i)
use(f(x++, y++));
}
/* { dg-final { scan-tree-dump-not "Duplicating join block" "split-paths" } } */
/* { dg-final { scan-tree-dump-times "Block . is a join that does not expose" 1 "split-paths" } } */
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