< prev index next >

src/hotspot/share/opto/memnode.cpp

Print this page
rev 54102 : 8261812: C2 compilation fails with assert(!had_error) failed: bad dominance
Reviewed-by: kvn, thartmann

*** 1993,2008 **** // If the previous store is to the same address as this load, // and the value stored was larger than a byte, replace this load // with the value stored truncated to a byte. If no truncation is // needed, the replacement is done in LoadNode::Identity(). // ! Node *LoadBNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); ! if( value && !phase->type(value)->higher_equal( _type ) ) { ! Node *result = phase->transform( new LShiftINode(value, phase->intcon(24)) ); ! return new RShiftINode(result, phase->intcon(24)); } // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); } --- 1993,2010 ---- // If the previous store is to the same address as this load, // and the value stored was larger than a byte, replace this load // with the value stored truncated to a byte. If no truncation is // needed, the replacement is done in LoadNode::Identity(). // ! Node* LoadBNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); ! if (value != NULL) { ! Node* narrow = Compile::narrow_value(T_BYTE, value, _type, phase, false); ! if (narrow != value) { ! return narrow; ! } } // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); }
*** 2028,2039 **** // needed, the replacement is done in LoadNode::Identity(). // Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem, phase); ! if (value && !phase->type(value)->higher_equal(_type)) ! return new AndINode(value, phase->intcon(0xFF)); // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); } const Type* LoadUBNode::Value(PhaseGVN* phase) const { --- 2030,2045 ---- // needed, the replacement is done in LoadNode::Identity(). // Node* LoadUBNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem, phase); ! if (value != NULL) { ! Node* narrow = Compile::narrow_value(T_BOOLEAN, value, _type, phase, false); ! if (narrow != value) { ! return narrow; ! } ! } // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); } const Type* LoadUBNode::Value(PhaseGVN* phase) const {
*** 2055,2069 **** // If the previous store is to the same address as this load, // and the value stored was larger than a char, replace this load // with the value stored truncated to a char. If no truncation is // needed, the replacement is done in LoadNode::Identity(). // ! Node *LoadUSNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); ! if( value && !phase->type(value)->higher_equal( _type ) ) ! return new AndINode(value,phase->intcon(0xFFFF)); // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); } const Type* LoadUSNode::Value(PhaseGVN* phase) const { --- 2061,2079 ---- // If the previous store is to the same address as this load, // and the value stored was larger than a char, replace this load // with the value stored truncated to a char. If no truncation is // needed, the replacement is done in LoadNode::Identity(). // ! Node* LoadUSNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); ! if (value != NULL) { ! Node* narrow = Compile::narrow_value(T_CHAR, value, _type, phase, false); ! if (narrow != value) { ! return narrow; ! } ! } // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); } const Type* LoadUSNode::Value(PhaseGVN* phase) const {
*** 2085,2100 **** // If the previous store is to the same address as this load, // and the value stored was larger than a short, replace this load // with the value stored truncated to a short. If no truncation is // needed, the replacement is done in LoadNode::Identity(). // ! Node *LoadSNode::Ideal(PhaseGVN *phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); ! if( value && !phase->type(value)->higher_equal( _type ) ) { ! Node *result = phase->transform( new LShiftINode(value, phase->intcon(16)) ); ! return new RShiftINode(result, phase->intcon(16)); } // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); } --- 2095,2112 ---- // If the previous store is to the same address as this load, // and the value stored was larger than a short, replace this load // with the value stored truncated to a short. If no truncation is // needed, the replacement is done in LoadNode::Identity(). // ! Node* LoadSNode::Ideal(PhaseGVN* phase, bool can_reshape) { Node* mem = in(MemNode::Memory); Node* value = can_see_stored_value(mem,phase); ! if (value != NULL) { ! Node* narrow = Compile::narrow_value(T_SHORT, value, _type, phase, false); ! if (narrow != value) { ! return narrow; ! } } // Identity call will handle the case where truncation is not needed. return LoadNode::Ideal(phase, can_reshape); }
< prev index next >