[llvm] 4ad59f9 - ValueTrackingTest.cpp - Pass DataLayout by reference. NFCI.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 8 02:42:05 PDT 2021
Author: Simon Pilgrim
Date: 2021-06-08T10:41:01+01:00
New Revision: 4ad59f9a5a9589e7d0608dafb99ee4f2db67cb95
URL: https://github.com/llvm/llvm-project/commit/4ad59f9a5a9589e7d0608dafb99ee4f2db67cb95
DIFF: https://github.com/llvm/llvm-project/commit/4ad59f9a5a9589e7d0608dafb99ee4f2db67cb95.diff
LOG: ValueTrackingTest.cpp - Pass DataLayout by reference. NFCI.
Added:
Modified:
llvm/unittests/Analysis/ValueTrackingTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/Analysis/ValueTrackingTest.cpp b/llvm/unittests/Analysis/ValueTrackingTest.cpp
index 2cfbc4cc65f55..3c61f24ba452b 100644
--- a/llvm/unittests/Analysis/ValueTrackingTest.cpp
+++ b/llvm/unittests/Analysis/ValueTrackingTest.cpp
@@ -1139,7 +1139,7 @@ TEST_F(ValueTrackingTest, computePtrAlignment) {
"}");
AssumptionCache AC(*F);
DominatorTree DT(*F);
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(getKnownAlignment(A, DL, CxtI, &AC, &DT), Align(1));
EXPECT_EQ(getKnownAlignment(A, DL, CxtI2, &AC, &DT), Align(1));
EXPECT_EQ(getKnownAlignment(A, DL, CxtI3, &AC, &DT), Align(16));
@@ -1189,7 +1189,7 @@ TEST_F(ValueTrackingTest, isNonZeroRecurrence) {
ret i1 %CxtI
}
)");
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
AssumptionCache AC(*F);
EXPECT_TRUE(isKnownNonZero(A, DL, 0, &AC, CxtI));
}
@@ -1213,7 +1213,7 @@ TEST_F(ValueTrackingTest, KnownNonZeroFromDomCond) {
)");
AssumptionCache AC(*F);
DominatorTree DT(*F);
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(isKnownNonZero(A, DL, 0, &AC, CxtI, &DT), true);
EXPECT_EQ(isKnownNonZero(A, DL, 0, &AC, CxtI2, &DT), false);
}
@@ -1237,7 +1237,7 @@ TEST_F(ValueTrackingTest, KnownNonZeroFromDomCond2) {
)");
AssumptionCache AC(*F);
DominatorTree DT(*F);
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(isKnownNonZero(A, DL, 0, &AC, CxtI, &DT), true);
EXPECT_EQ(isKnownNonZero(A, DL, 0, &AC, CxtI2, &DT), false);
}
@@ -1255,7 +1255,7 @@ TEST_F(ValueTrackingTest, IsImpliedConditionAnd) {
ret void
}
)");
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(isImpliedCondition(A, A2, DL), true);
EXPECT_EQ(isImpliedCondition(A, A3, DL), false);
EXPECT_EQ(isImpliedCondition(A, A4, DL), None);
@@ -1274,7 +1274,7 @@ TEST_F(ValueTrackingTest, IsImpliedConditionAnd2) {
ret void
}
)");
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(isImpliedCondition(A, A2, DL), true);
EXPECT_EQ(isImpliedCondition(A, A3, DL), false);
EXPECT_EQ(isImpliedCondition(A, A4, DL), None);
@@ -1293,7 +1293,7 @@ TEST_F(ValueTrackingTest, IsImpliedConditionOr) {
ret void
}
)");
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(isImpliedCondition(A, A2, DL, false), false);
EXPECT_EQ(isImpliedCondition(A, A3, DL, false), true);
EXPECT_EQ(isImpliedCondition(A, A4, DL, false), None);
@@ -1312,7 +1312,7 @@ TEST_F(ValueTrackingTest, IsImpliedConditionOr2) {
ret void
}
)");
- DataLayout DL = M->getDataLayout();
+ const DataLayout &DL = M->getDataLayout();
EXPECT_EQ(isImpliedCondition(A, A2, DL, false), false);
EXPECT_EQ(isImpliedCondition(A, A3, DL, false), true);
EXPECT_EQ(isImpliedCondition(A, A4, DL, false), None);
More information about the llvm-commits
mailing list