Skip to content

Commit c19f0f0

Browse files
authored
[PatternMatch] Make m_SpecificMask pass expected mask by Value. NFC (#121527)
Unlike m_Mask, we don't need to modify a variable owned by the caller so we should pass the ArrayRef by value or const reference.
1 parent 715dcb2 commit c19f0f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/include/llvm/IR/PatternMatch.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,9 +1844,9 @@ struct m_ZeroMask {
18441844
};
18451845

18461846
struct m_SpecificMask {
1847-
ArrayRef<int> &MaskRef;
1848-
m_SpecificMask(ArrayRef<int> &MaskRef) : MaskRef(MaskRef) {}
1849-
bool match(ArrayRef<int> Mask) { return MaskRef == Mask; }
1847+
ArrayRef<int> Val;
1848+
m_SpecificMask(ArrayRef<int> Val) : Val(Val) {}
1849+
bool match(ArrayRef<int> Mask) { return Val == Mask; }
18501850
};
18511851

18521852
struct m_SplatOrPoisonMask {

0 commit comments

Comments
 (0)