Skip to content

Commit

Permalink
[SelectionDAG] Restore calls to has_value (NFC)
Browse files Browse the repository at this point in the history
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 d08f34b.

Differential Revision: https://reviews.llvm.org/D129454
  • Loading branch information
kazutakahirata committed Jul 10, 2022
1 parent 35ec8a4 commit 1fd6611
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Expand Up @@ -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();

Expand Down

0 comments on commit 1fd6611

Please sign in to comment.