forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tree-optimization/116902 - vectorizer load hosting breaks UID order #2
This is another case of load hoisting breaking UID order in the preheader, this time between two hoistings. The easiest way out is to do what we do for the main stmt - copy instead of move. PR tree-optimization/116902 PR tree-optimization/116842 * tree-vect-stmts.cc (sort_after_uid): Remove again. (hoist_defs_of_uses): Copy defs instead of hoisting them so we can zero their UID. (vectorizable_load): Separate analysis and transform call, do transform on the stmt copy. * g++.dg/torture/pr116902.C: New testcase.
- Loading branch information
Showing
2 changed files
with
45 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// { dg-do compile } | ||
// { dg-additional-options "-ftree-vectorize" } | ||
|
||
template<typename _Tp> | ||
inline const _Tp& | ||
min(const _Tp& __a, const _Tp& __b) | ||
{ | ||
if (__b < __a) | ||
return __b; | ||
return __a; | ||
} | ||
|
||
unsigned a; | ||
void i(long b, char c[][4], long d[][4]) { | ||
for (char e; e; e++) | ||
for (char f = 0; f < 021; f = b) | ||
for (signed char g; g < 7; g += ~0) | ||
for (bool h = 0; h < bool(d[f][f]); h = 1) | ||
a = c[2][1] - min(c[1][f + 1], c[2][f + 2]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters