--- a/hotspot/src/share/vm/opto/loopopts.cpp Fri Dec 18 20:23:28 2015 +0300
+++ b/hotspot/src/share/vm/opto/loopopts.cpp Fri Dec 11 16:57:08 2015 +0100
@@ -26,6 +26,7 @@
#include "memory/allocation.inline.hpp"
#include "opto/addnode.hpp"
#include "opto/connode.hpp"
+#include "opto/castnode.hpp"
#include "opto/divnode.hpp"
#include "opto/loopnode.hpp"
#include "opto/matcher.hpp"
@@ -900,6 +901,14 @@
Node *m = remix_address_expressions( n );
if( m ) return m;
+ if (n->is_ConstraintCast()) {
+ Node* dom_cast = n->as_ConstraintCast()->dominating_cast(this);
+ if (dom_cast != NULL) {
+ _igvn.replace_node(n, dom_cast);
+ return dom_cast;
+ }
+ }
+
// Determine if the Node has inputs from some local Phi.
// Returns the block to clone thru.
Node *n_blk = has_local_phi_input( n );