NullCheck is currently tagged with `isLocalDefUse` on all targets. However, for XARCH it is implemented with a compare (no target), and for ARM64 it is implemented with a load to REG_ZR, so neither of those require a target register.
Only on ARM is a target register required, and it is a localDefUse because the result is not used.
break;
case GT_NULLCHECK:
- assert(info->dstCount == 0);
+ // Although NULLCHECK is defined as GTK_NOVALUE, it requires a target
+ // register on ARM, as it is implemented as a load.
+ info->dstCount = 1;
info->srcCount = 1;
info->isLocalDefUse = true;
// null check is an indirection on an addr
break;
case GT_NULLCHECK:
+ // Unlike ARM, ARM64 implements NULLCHECK as a load to REG_ZR, so no target register
+ // is required, and it is not a localDefUse.
assert(info->dstCount == 0);
- info->srcCount = 1;
- info->isLocalDefUse = true;
+ info->srcCount = 1;
// null check is an indirection on an addr
TreeNodeInfoInitIndir(tree->AsIndir());
break;
case GT_NULLCHECK:
assert(info->dstCount == 0);
- info->srcCount = 1;
- info->isLocalDefUse = true;
+ info->srcCount = 1;
break;
case GT_IND: