[SelectionDAG] Restore calls to has_value (NFC)

This patch restores calls to has_value to make it clear that we are
checking the presence of an optional value, not the underlying value.

This patch partially reverts d08f34b592.

Differential Revision: https://reviews.llvm.org/D129454
This commit is contained in:
Kazu Hirata 2022-07-10 14:37:23 -07:00
parent 35ec8a423d
commit 1fd6611fc8
1 changed files with 3 additions and 2 deletions

View File

@ -24536,8 +24536,9 @@ bool DAGCombiner::mayAlias(SDNode *Op0, SDNode *Op1) const {
auto &Size0 = MUC0.NumBytes;
auto &Size1 = MUC1.NumBytes;
if (OrigAlignment0 == OrigAlignment1 && SrcValOffset0 != SrcValOffset1 &&
Size0 && Size1 && *Size0 == *Size1 && OrigAlignment0 > *Size0 &&
SrcValOffset0 % *Size0 == 0 && SrcValOffset1 % *Size1 == 0) {
Size0.has_value() && Size1.has_value() && *Size0 == *Size1 &&
OrigAlignment0 > *Size0 && SrcValOffset0 % *Size0 == 0 &&
SrcValOffset1 % *Size1 == 0) {
int64_t OffAlign0 = SrcValOffset0 % OrigAlignment0.value();
int64_t OffAlign1 = SrcValOffset1 % OrigAlignment1.value();