mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
[ValueLattice] Remove unused DataLayout parameter of mergeIn, NFC
Reviewed By: fhahn, echristo Differential Revision: https://reviews.llvm.org/D78061
This commit is contained in:
parent
180c8196c1
commit
ac540cb0fe
@ -321,7 +321,7 @@ public:
|
|||||||
|
|
||||||
/// Updates this object to approximate both this object and RHS. Returns
|
/// Updates this object to approximate both this object and RHS. Returns
|
||||||
/// true if this object has been changed.
|
/// true if this object has been changed.
|
||||||
bool mergeIn(const ValueLatticeElement &RHS, const DataLayout &DL) {
|
bool mergeIn(const ValueLatticeElement &RHS) {
|
||||||
if (RHS.isUnknown() || isOverdefined())
|
if (RHS.isUnknown() || isOverdefined())
|
||||||
return false;
|
return false;
|
||||||
if (RHS.isOverdefined()) {
|
if (RHS.isOverdefined()) {
|
||||||
|
@ -747,7 +747,7 @@ bool LazyValueInfoImpl::solveBlockValueNonLocal(ValueLatticeElement &BBLV,
|
|||||||
// Explore that input, then return here
|
// Explore that input, then return here
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Result.mergeIn(EdgeResult, DL);
|
Result.mergeIn(EdgeResult);
|
||||||
|
|
||||||
// If we hit overdefined, exit early. The BlockVals entry is already set
|
// If we hit overdefined, exit early. The BlockVals entry is already set
|
||||||
// to overdefined.
|
// to overdefined.
|
||||||
@ -791,7 +791,7 @@ bool LazyValueInfoImpl::solveBlockValuePHINode(ValueLatticeElement &BBLV,
|
|||||||
// Explore that input, then return here
|
// Explore that input, then return here
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Result.mergeIn(EdgeResult, DL);
|
Result.mergeIn(EdgeResult);
|
||||||
|
|
||||||
// If we hit overdefined, exit early. The BlockVals entry is already set
|
// If we hit overdefined, exit early. The BlockVals entry is already set
|
||||||
// to overdefined.
|
// to overdefined.
|
||||||
@ -989,8 +989,8 @@ bool LazyValueInfoImpl::solveBlockValueSelect(ValueLatticeElement &BBLV,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ValueLatticeElement Result; // Start Undefined.
|
ValueLatticeElement Result; // Start Undefined.
|
||||||
Result.mergeIn(TrueVal, DL);
|
Result.mergeIn(TrueVal);
|
||||||
Result.mergeIn(FalseVal, DL);
|
Result.mergeIn(FalseVal);
|
||||||
BBLV = Result;
|
BBLV = Result;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -409,7 +409,7 @@ private:
|
|||||||
markOverdefined(IV, V);
|
markOverdefined(IV, V);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (IV.mergeIn(MergeWithV, DL)) {
|
if (IV.mergeIn(MergeWithV)) {
|
||||||
pushToWorkList(IV, V);
|
pushToWorkList(IV, V);
|
||||||
LLVM_DEBUG(dbgs() << "Merged " << MergeWithV << " into " << *V << " : "
|
LLVM_DEBUG(dbgs() << "Merged " << MergeWithV << " into " << *V << " : "
|
||||||
<< IV << "\n");
|
<< IV << "\n");
|
||||||
@ -743,7 +743,7 @@ void SCCPSolver::visitPHINode(PHINode &PN) {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
ValueLatticeElement &Res = getValueState(&PN);
|
ValueLatticeElement &Res = getValueState(&PN);
|
||||||
Changed |= Res.mergeIn(IV, DL);
|
Changed |= Res.mergeIn(IV);
|
||||||
if (Res.isOverdefined())
|
if (Res.isOverdefined())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -909,8 +909,8 @@ void SCCPSolver::visitSelectInst(SelectInst &I) {
|
|||||||
ValueLatticeElement TVal = getValueState(I.getTrueValue());
|
ValueLatticeElement TVal = getValueState(I.getTrueValue());
|
||||||
ValueLatticeElement FVal = getValueState(I.getFalseValue());
|
ValueLatticeElement FVal = getValueState(I.getFalseValue());
|
||||||
|
|
||||||
bool Changed = ValueState[&I].mergeIn(TVal, DL);
|
bool Changed = ValueState[&I].mergeIn(TVal);
|
||||||
Changed |= ValueState[&I].mergeIn(FVal, DL);
|
Changed |= ValueState[&I].mergeIn(FVal);
|
||||||
if (Changed)
|
if (Changed)
|
||||||
pushToWorkListMsg(ValueState[&I], &I);
|
pushToWorkListMsg(ValueState[&I], &I);
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,6 @@ namespace {
|
|||||||
class ValueLatticeTest : public testing::Test {
|
class ValueLatticeTest : public testing::Test {
|
||||||
protected:
|
protected:
|
||||||
LLVMContext Context;
|
LLVMContext Context;
|
||||||
Module M;
|
|
||||||
|
|
||||||
ValueLatticeTest() : M("", Context) {}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(ValueLatticeTest, ValueLatticeGetters) {
|
TEST_F(ValueLatticeTest, ValueLatticeGetters) {
|
||||||
@ -66,26 +63,26 @@ TEST_F(ValueLatticeTest, MergeIn) {
|
|||||||
|
|
||||||
// Merge to lattice values with equal integer constant.
|
// Merge to lattice values with equal integer constant.
|
||||||
auto LV1 = ValueLatticeElement::get(C1);
|
auto LV1 = ValueLatticeElement::get(C1);
|
||||||
EXPECT_FALSE(LV1.mergeIn(ValueLatticeElement::get(C1), M.getDataLayout()));
|
EXPECT_FALSE(LV1.mergeIn(ValueLatticeElement::get(C1)));
|
||||||
EXPECT_TRUE(LV1.isConstantRange());
|
EXPECT_TRUE(LV1.isConstantRange());
|
||||||
EXPECT_EQ(LV1.asConstantInteger().getValue().getLimitedValue(), 1U);
|
EXPECT_EQ(LV1.asConstantInteger().getValue().getLimitedValue(), 1U);
|
||||||
|
|
||||||
// Merge LV1 with different integer constant.
|
// Merge LV1 with different integer constant.
|
||||||
EXPECT_TRUE(LV1.mergeIn(ValueLatticeElement::get(ConstantInt::get(I32Ty, 99)),
|
EXPECT_TRUE(
|
||||||
M.getDataLayout()));
|
LV1.mergeIn(ValueLatticeElement::get(ConstantInt::get(I32Ty, 99))));
|
||||||
EXPECT_TRUE(LV1.isConstantRange());
|
EXPECT_TRUE(LV1.isConstantRange());
|
||||||
EXPECT_EQ(LV1.getConstantRange().getLower().getLimitedValue(), 1U);
|
EXPECT_EQ(LV1.getConstantRange().getLower().getLimitedValue(), 1U);
|
||||||
EXPECT_EQ(LV1.getConstantRange().getUpper().getLimitedValue(), 100U);
|
EXPECT_EQ(LV1.getConstantRange().getUpper().getLimitedValue(), 100U);
|
||||||
|
|
||||||
// Merge constant range with same constant range.
|
// Merge constant range with same constant range.
|
||||||
EXPECT_FALSE(LV1.mergeIn(LV1, M.getDataLayout()));
|
EXPECT_FALSE(LV1.mergeIn(LV1));
|
||||||
EXPECT_TRUE(LV1.isConstantRange());
|
EXPECT_TRUE(LV1.isConstantRange());
|
||||||
EXPECT_EQ(LV1.getConstantRange().getLower().getLimitedValue(), 1U);
|
EXPECT_EQ(LV1.getConstantRange().getLower().getLimitedValue(), 1U);
|
||||||
EXPECT_EQ(LV1.getConstantRange().getUpper().getLimitedValue(), 100U);
|
EXPECT_EQ(LV1.getConstantRange().getUpper().getLimitedValue(), 100U);
|
||||||
|
|
||||||
// Merge LV1 in undefined value.
|
// Merge LV1 in undefined value.
|
||||||
ValueLatticeElement LV2;
|
ValueLatticeElement LV2;
|
||||||
EXPECT_TRUE(LV2.mergeIn(LV1, M.getDataLayout()));
|
EXPECT_TRUE(LV2.mergeIn(LV1));
|
||||||
EXPECT_TRUE(LV1.isConstantRange());
|
EXPECT_TRUE(LV1.isConstantRange());
|
||||||
EXPECT_EQ(LV1.getConstantRange().getLower().getLimitedValue(), 1U);
|
EXPECT_EQ(LV1.getConstantRange().getLower().getLimitedValue(), 1U);
|
||||||
EXPECT_EQ(LV1.getConstantRange().getUpper().getLimitedValue(), 100U);
|
EXPECT_EQ(LV1.getConstantRange().getUpper().getLimitedValue(), 100U);
|
||||||
@ -94,13 +91,11 @@ TEST_F(ValueLatticeTest, MergeIn) {
|
|||||||
EXPECT_EQ(LV2.getConstantRange().getUpper().getLimitedValue(), 100U);
|
EXPECT_EQ(LV2.getConstantRange().getUpper().getLimitedValue(), 100U);
|
||||||
|
|
||||||
// Merge LV1 with overdefined.
|
// Merge LV1 with overdefined.
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(LV1.mergeIn(ValueLatticeElement::getOverdefined()));
|
||||||
LV1.mergeIn(ValueLatticeElement::getOverdefined(), M.getDataLayout()));
|
|
||||||
EXPECT_TRUE(LV1.isOverdefined());
|
EXPECT_TRUE(LV1.isOverdefined());
|
||||||
|
|
||||||
// Merge overdefined with overdefined.
|
// Merge overdefined with overdefined.
|
||||||
EXPECT_FALSE(
|
EXPECT_FALSE(LV1.mergeIn(ValueLatticeElement::getOverdefined()));
|
||||||
LV1.mergeIn(ValueLatticeElement::getOverdefined(), M.getDataLayout()));
|
|
||||||
EXPECT_TRUE(LV1.isOverdefined());
|
EXPECT_TRUE(LV1.isOverdefined());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,8 +160,7 @@ TEST_F(ValueLatticeTest, getCompareFloat) {
|
|||||||
EXPECT_TRUE(LV1.getCompare(CmpInst::FCMP_OGT, I1Ty, LV2)->isZeroValue());
|
EXPECT_TRUE(LV1.getCompare(CmpInst::FCMP_OGT, I1Ty, LV2)->isZeroValue());
|
||||||
|
|
||||||
EXPECT_TRUE(
|
EXPECT_TRUE(
|
||||||
LV1.mergeIn(ValueLatticeElement::get(ConstantFP::get(FloatTy, 2.2)),
|
LV1.mergeIn(ValueLatticeElement::get(ConstantFP::get(FloatTy, 2.2))));
|
||||||
M.getDataLayout()));
|
|
||||||
EXPECT_EQ(LV1.getCompare(CmpInst::FCMP_OEQ, I1Ty, LV2), nullptr);
|
EXPECT_EQ(LV1.getCompare(CmpInst::FCMP_OEQ, I1Ty, LV2), nullptr);
|
||||||
EXPECT_EQ(LV1.getCompare(CmpInst::FCMP_OGE, I1Ty, LV2), nullptr);
|
EXPECT_EQ(LV1.getCompare(CmpInst::FCMP_OGE, I1Ty, LV2), nullptr);
|
||||||
EXPECT_EQ(LV1.getCompare(CmpInst::FCMP_OLE, I1Ty, LV2), nullptr);
|
EXPECT_EQ(LV1.getCompare(CmpInst::FCMP_OLE, I1Ty, LV2), nullptr);
|
||||||
|
Loading…
Reference in New Issue
Block a user