Skip to content

Commit e5542a3

Browse files
committed
[PatternMatch] m_SpecificMask should pass expected mask by Value. NFC
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 f03b100 commit e5542a3

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)