8149543: range check CastII nodes should not be split through Phi
authorroland
Thu, 11 Feb 2016 12:42:12 +0100
changeset 36067 63eabfc8429b
parent 36066 60ce66ce3c76
child 36068 54f407187922
child 36069 19e59f0ddda9
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
hotspot/src/share/vm/opto/loopopts.cpp
--- a/hotspot/src/share/vm/opto/loopopts.cpp	Fri Feb 12 16:12:15 2016 -0800
+++ b/hotspot/src/share/vm/opto/loopopts.cpp	Thu Feb 11 12:42:12 2016 +0100
@@ -47,6 +47,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(), "");