Skip to content

Commit

Permalink
Enable VN constant propagation for small types
Browse files Browse the repository at this point in the history
  • Loading branch information
SingleAccretion committed Aug 19, 2021
1 parent d35b132 commit 97f96dd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/coreclr/jit/assertionprop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2667,8 +2667,17 @@ GenTree* Compiler::optVNConstantPropOnTree(BasicBlock* block, GenTree* tree)
unreached();
break;

case TYP_BOOL:
case TYP_BYTE:
case TYP_UBYTE:
case TYP_SHORT:
case TYP_USHORT:
assert(FitsIn(tree->TypeGet(), value));
conValTree = gtNewIconNode(value);
break;

default:
// Do not support (e.g. bool(const int)).
// Do not support (e.g. byref(const int)).
break;
}
}
Expand Down

0 comments on commit 97f96dd

Please sign in to comment.