changeset 5868:aa627f367a9a

8149543: range check CastII nodes should not be split through Phi Summary: splitting range check CastIIs through loop induction Phi prevents further optimizations Reviewed-by: kvn, mcberg
author roland
date Wed, 05 Feb 2020 04:12:59 +0000
parents 2ab077a70b79
children 79dd5370ad0f
files src/share/vm/opto/loopopts.cpp
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/loopopts.cpp	Tue Feb 04 17:02:36 2020 +0000
+++ b/src/share/vm/opto/loopopts.cpp	Wed Feb 05 04:12:59 2020 +0000
@@ -42,6 +42,15 @@
     // so disable this for now
     return NULL;
   }
+
+  // Splitting range check CastIIs through a loop induction Phi can
+  // cause new Phis to be created that are left unrelated to the loop
+  // induction Phi and prevent optimizations (vectorization)
+  if (n->Opcode() == Op_CastII && n->as_CastII()->has_range_check() &&
+      region->is_CountedLoop() && n->in(1) == region->as_CountedLoop()->phi()) {
+    return NULL;
+  }
+
   int wins = 0;
   assert(!n->is_CFG(), "");
   assert(region->is_Region(), "");