changeset 23818:5c3f2bcc3b94

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 Thu, 11 Feb 2016 12:42:12 +0100
parents c9035b8e388b
children c66164388d38
files src/share/vm/opto/loopopts.cpp
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/loopopts.cpp	Wed Feb 03 10:58:50 2016 +0100
+++ b/src/share/vm/opto/loopopts.cpp	Thu Feb 11 12:42:12 2016 +0100
@@ -43,6 +43,14 @@
     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(), "");