< prev index next >
src/hotspot/share/opto/castnode.cpp
Print this page
*** 25,38 ****
--- 25,41 ----
#include "precompiled.hpp"
#include "opto/addnode.hpp"
#include "opto/callnode.hpp"
#include "opto/castnode.hpp"
#include "opto/connode.hpp"
+ #include "opto/graphKit.hpp"
#include "opto/matcher.hpp"
#include "opto/phaseX.hpp"
+ #include "opto/rootnode.hpp"
#include "opto/subnode.hpp"
#include "opto/type.hpp"
+ #include "opto/valuetypenode.hpp"
//=============================================================================
// If input is already higher or equal to cast type, then this is an identity.
Node* ConstraintCastNode::Identity(PhaseGVN* phase) {
Node* dom = dominating_cast(phase, phase);
*** 460,469 ****
--- 463,488 ----
if (t == Type::TOP) return Type::TOP;
if (t->base() == Type::RawPtr && t->singleton()) {
uintptr_t bits = (uintptr_t) t->is_rawptr()->get_con();
return TypeX::make(bits);
}
+
+ if (t->is_zero_type() || !t->maybe_null()) {
+ for (DUIterator_Fast imax, i = fast_outs(imax); i < imax; i++) {
+ Node* u = fast_out(i);
+ if (u->Opcode() == Op_OrL) {
+ for (DUIterator_Fast jmax, j = u->fast_outs(jmax); j < jmax; j++) {
+ Node* cmp = u->fast_out(j);
+ if (cmp->Opcode() == Op_CmpL) {
+ // Give CmpL a chance to get optimized
+ phase->record_for_igvn(cmp);
+ }
+ }
+ }
+ }
+ }
+
return CastP2XNode::bottom_type();
}
Node *CastP2XNode::Ideal(PhaseGVN *phase, bool can_reshape) {
return (in(0) && remove_dead_region(phase, can_reshape)) ? this : NULL;
< prev index next >