@@ -1995,7 +1995,7 @@ TEST_F(PatternMatchTest, VScale) {
1995
1995
EXPECT_TRUE (match (PtrToInt2, m_VScale ()));
1996
1996
}
1997
1997
1998
- TEST_F (PatternMatchTest, NotForbidUndef ) {
1998
+ TEST_F (PatternMatchTest, NotForbidPoison ) {
1999
1999
Type *ScalarTy = IRB.getInt8Ty ();
2000
2000
Type *VectorTy = FixedVectorType::get (ScalarTy, 3 );
2001
2001
Constant *ScalarUndef = UndefValue::get (ScalarTy);
@@ -2020,23 +2020,33 @@ TEST_F(PatternMatchTest, NotForbidUndef) {
2020
2020
Value *X;
2021
2021
EXPECT_TRUE (match (Not, m_Not (m_Value (X))));
2022
2022
EXPECT_TRUE (match (X, m_Zero ()));
2023
+ X = nullptr ;
2024
+ EXPECT_TRUE (match (Not, m_NotForbidPoison (m_Value (X))));
2025
+ EXPECT_TRUE (match (X, m_Zero ()));
2023
2026
2024
2027
Value *NotCommute = IRB.CreateXor (VectorOnes, VectorZero);
2025
2028
Value *Y;
2026
2029
EXPECT_TRUE (match (NotCommute, m_Not (m_Value (Y))));
2027
2030
EXPECT_TRUE (match (Y, m_Zero ()));
2031
+ Y = nullptr ;
2032
+ EXPECT_TRUE (match (NotCommute, m_NotForbidPoison (m_Value (Y))));
2033
+ EXPECT_TRUE (match (Y, m_Zero ()));
2028
2034
2029
2035
Value *NotWithUndefs = IRB.CreateXor (VectorZero, VectorMixedUndef);
2030
2036
EXPECT_FALSE (match (NotWithUndefs, m_Not (m_Value ())));
2037
+ EXPECT_FALSE (match (NotWithUndefs, m_NotForbidPoison (m_Value ())));
2031
2038
2032
2039
Value *NotWithPoisons = IRB.CreateXor (VectorZero, VectorMixedPoison);
2033
2040
EXPECT_TRUE (match (NotWithPoisons, m_Not (m_Value ())));
2041
+ EXPECT_FALSE (match (NotWithPoisons, m_NotForbidPoison (m_Value ())));
2034
2042
2035
2043
Value *NotWithUndefsCommute = IRB.CreateXor (VectorMixedUndef, VectorZero);
2036
2044
EXPECT_FALSE (match (NotWithUndefsCommute, m_Not (m_Value ())));
2045
+ EXPECT_FALSE (match (NotWithUndefsCommute, m_NotForbidPoison (m_Value ())));
2037
2046
2038
2047
Value *NotWithPoisonsCommute = IRB.CreateXor (VectorMixedPoison, VectorZero);
2039
2048
EXPECT_TRUE (match (NotWithPoisonsCommute, m_Not (m_Value ())));
2049
+ EXPECT_FALSE (match (NotWithPoisonsCommute, m_NotForbidPoison (m_Value ())));
2040
2050
}
2041
2051
2042
2052
template <typename T> struct MutableConstTest : PatternMatchTest { };
0 commit comments