[llvm] 6f9e3f3 - [NFC] Fix function naming conventions in PHITransAddr methods
Sergey Kachkov via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 2 05:39:14 PST 2023
Author: Sergey Kachkov
Date: 2023-02-02T16:38:39+03:00
New Revision: 6f9e3f3b339e4a595da9304f299c07c276cec93c
URL: https://github.com/llvm/llvm-project/commit/6f9e3f3b339e4a595da9304f299c07c276cec93c
DIFF: https://github.com/llvm/llvm-project/commit/6f9e3f3b339e4a595da9304f299c07c276cec93c.diff
LOG: [NFC] Fix function naming conventions in PHITransAddr methods
Differential Revision: https://reviews.llvm.org/D143166
Added:
Modified:
llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
llvm/include/llvm/Analysis/MemorySSA.h
llvm/include/llvm/Analysis/PHITransAddr.h
llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
llvm/lib/Analysis/PHITransAddr.cpp
llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
llvm/lib/Transforms/Scalar/GVN.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
index f66b42929429e..27185aa9942e4 100644
--- a/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
+++ b/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h
@@ -208,11 +208,11 @@ class NonLocalDepEntry {
MemDepResult Result;
public:
- NonLocalDepEntry(BasicBlock *bb, MemDepResult result)
- : BB(bb), Result(result) {}
+ NonLocalDepEntry(BasicBlock *BB, MemDepResult Result)
+ : BB(BB), Result(Result) {}
// This is used for searches.
- NonLocalDepEntry(BasicBlock *bb) : BB(bb) {}
+ NonLocalDepEntry(BasicBlock *BB) : BB(BB) {}
// BB is the sort key, it can't be changed.
BasicBlock *getBB() const { return BB; }
@@ -233,8 +233,8 @@ class NonLocalDepResult {
Value *Address;
public:
- NonLocalDepResult(BasicBlock *bb, MemDepResult result, Value *address)
- : Entry(bb, result), Address(address) {}
+ NonLocalDepResult(BasicBlock *BB, MemDepResult Result, Value *Address)
+ : Entry(BB, Result), Address(Address) {}
// BB is the sort key, it can't be changed.
BasicBlock *getBB() const { return Entry.getBB(); }
diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h
index d861057cb8cb6..68e2dc80a12f4 100644
--- a/llvm/include/llvm/Analysis/MemorySSA.h
+++ b/llvm/include/llvm/Analysis/MemorySSA.h
@@ -1272,8 +1272,8 @@ class upward_defs_iterator
const_cast<Value *>(Location.Ptr),
OriginalAccess->getBlock()->getModule()->getDataLayout(), nullptr);
- if (!Translator.PHITranslateValue(OriginalAccess->getBlock(),
- DefIterator.getPhiArgBlock(), DT, true))
+ if (!Translator.translateValue(OriginalAccess->getBlock(),
+ DefIterator.getPhiArgBlock(), DT, true))
if (Translator.getAddr() != CurrentPair.second.Ptr)
CurrentPair.second =
CurrentPair.second.getWithNewPtr(Translator.getAddr());
diff --git a/llvm/include/llvm/Analysis/PHITransAddr.h b/llvm/include/llvm/Analysis/PHITransAddr.h
index a23f8e61c3033..ec6dbb227af77 100644
--- a/llvm/include/llvm/Analysis/PHITransAddr.h
+++ b/llvm/include/llvm/Analysis/PHITransAddr.h
@@ -17,10 +17,10 @@
#include "llvm/IR/Instruction.h"
namespace llvm {
- class AssumptionCache;
- class DominatorTree;
- class DataLayout;
- class TargetLibraryInfo;
+class AssumptionCache;
+class DominatorTree;
+class DataLayout;
+class TargetLibraryInfo;
/// PHITransAddr - An address value which tracks and handles phi translation.
/// As we walk "up" the CFG through predecessors, we need to ensure that the
@@ -49,8 +49,8 @@ class PHITransAddr {
SmallVector<Instruction*, 4> InstInputs;
public:
- PHITransAddr(Value *addr, const DataLayout &DL, AssumptionCache *AC)
- : Addr(addr), DL(DL), AC(AC) {
+ PHITransAddr(Value *Addr, const DataLayout &DL, AssumptionCache *AC)
+ : Addr(Addr), DL(DL), AC(AC) {
// If the address is an instruction, the whole thing is considered an input.
if (Instruction *I = dyn_cast<Instruction>(Addr))
InstInputs.push_back(I);
@@ -58,9 +58,9 @@ class PHITransAddr {
Value *getAddr() const { return Addr; }
- /// NeedsPHITranslationFromBlock - Return true if moving from the specified
+ /// needsPHITranslationFromBlock - Return true if moving from the specified
/// BasicBlock to its predecessors requires PHI translation.
- bool NeedsPHITranslationFromBlock(BasicBlock *BB) const {
+ bool needsPHITranslationFromBlock(BasicBlock *BB) const {
// We do need translation if one of our input instructions is defined in
// this block.
for (unsigned i = 0, e = InstInputs.size(); i != e; ++i)
@@ -69,51 +69,51 @@ class PHITransAddr {
return false;
}
- /// IsPotentiallyPHITranslatable - If this needs PHI translation, return true
+ /// isPotentiallyPHITranslatable - If this needs PHI translation, return true
/// if we have some hope of doing it. This should be used as a filter to
/// avoid calling PHITranslateValue in hopeless situations.
- bool IsPotentiallyPHITranslatable() const;
+ bool isPotentiallyPHITranslatable() const;
- /// PHITranslateValue - PHI translate the current address up the CFG from
+ /// translateValue - PHI translate the current address up the CFG from
/// CurBB to Pred, updating our state to reflect any needed changes. If
/// 'MustDominate' is true, the translated value must dominate
/// PredBB. This returns true on failure and sets Addr to null.
- bool PHITranslateValue(BasicBlock *CurBB, BasicBlock *PredBB,
- const DominatorTree *DT, bool MustDominate);
+ bool translateValue(BasicBlock *CurBB, BasicBlock *PredBB,
+ const DominatorTree *DT, bool MustDominate);
- /// PHITranslateWithInsertion - PHI translate this value into the specified
+ /// translateWithInsertion - PHI translate this value into the specified
/// predecessor block, inserting a computation of the value if it is
/// unavailable.
///
/// All newly created instructions are added to the NewInsts list. This
/// returns null on failure.
///
- Value *PHITranslateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB,
- const DominatorTree &DT,
- SmallVectorImpl<Instruction *> &NewInsts);
+ Value *translateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB,
+ const DominatorTree &DT,
+ SmallVectorImpl<Instruction *> &NewInsts);
void dump() const;
- /// Verify - Check internal consistency of this data structure. If the
+ /// verify - Check internal consistency of this data structure. If the
/// structure is valid, it returns true. If invalid, it prints errors and
/// returns false.
- bool Verify() const;
+ bool verify() const;
private:
- Value *PHITranslateSubExpr(Value *V, BasicBlock *CurBB, BasicBlock *PredBB,
- const DominatorTree *DT);
+ Value *translateSubExpr(Value *V, BasicBlock *CurBB, BasicBlock *PredBB,
+ const DominatorTree *DT);
- /// InsertPHITranslatedSubExpr - Insert a computation of the PHI translated
+ /// insertTranslatedSubExpr - Insert a computation of the PHI translated
/// version of 'V' for the edge PredBB->CurBB into the end of the PredBB
/// block. All newly created instructions are added to the NewInsts list.
/// This returns null on failure.
///
- Value *InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
- BasicBlock *PredBB, const DominatorTree &DT,
- SmallVectorImpl<Instruction *> &NewInsts);
+ Value *insertTranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
+ BasicBlock *PredBB, const DominatorTree &DT,
+ SmallVectorImpl<Instruction *> &NewInsts);
- /// AddAsInput - If the specified value is an instruction, add it as an input.
- Value *AddAsInput(Value *V) {
+ /// addAsInput - If the specified value is an instruction, add it as an input.
+ Value *addAsInput(Value *V) {
// If V is an instruction, it is now an input.
if (Instruction *VI = dyn_cast<Instruction>(V))
InstInputs.push_back(VI);
diff --git a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
index 93c388abb0fdc..aeed5a0e66e97 100644
--- a/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -1238,7 +1238,7 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(
// phi translation to change it into a value live in the predecessor block.
// If not, we just add the predecessors to the worklist and scan them with
// the same Pointer.
- if (!Pointer.NeedsPHITranslationFromBlock(BB)) {
+ if (!Pointer.needsPHITranslationFromBlock(BB)) {
SkipFirstBlock = false;
SmallVector<BasicBlock *, 16> NewBlocks;
for (BasicBlock *Pred : PredCache.get(BB)) {
@@ -1277,7 +1277,7 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(
// We do need to do phi translation, if we know ahead of time we can't phi
// translate this value, don't even try.
- if (!Pointer.IsPotentiallyPHITranslatable())
+ if (!Pointer.isPotentiallyPHITranslatable())
goto PredTranslationFailure;
// We may have added values to the cache list before this PHI translation.
@@ -1298,7 +1298,7 @@ bool MemoryDependenceResults::getNonLocalPointerDepFromBB(
// Get the PHI translated pointer in this predecessor. This can fail if
// not translatable, in which case the getAddr() returns null.
PHITransAddr &PredPointer = PredList.back().second;
- PredPointer.PHITranslateValue(BB, Pred, &DT, /*MustDominate=*/false);
+ PredPointer.translateValue(BB, Pred, &DT, /*MustDominate=*/false);
Value *PredPtrVal = PredPointer.getAddr();
// Check to see if we have already visited this pred block with another
diff --git a/llvm/lib/Analysis/PHITransAddr.cpp b/llvm/lib/Analysis/PHITransAddr.cpp
index 1262530ae6423..1c3e55b47f045 100644
--- a/llvm/lib/Analysis/PHITransAddr.cpp
+++ b/llvm/lib/Analysis/PHITransAddr.cpp
@@ -25,7 +25,7 @@ static cl::opt<bool> EnableAddPhiTranslation(
"gvn-add-phi-translation", cl::init(false), cl::Hidden,
cl::desc("Enable phi-translation of add instructions"));
-static bool CanPHITrans(Instruction *Inst) {
+static bool canPHITrans(Instruction *Inst) {
if (isa<PHINode>(Inst) ||
isa<GetElementPtrInst>(Inst))
return true;
@@ -53,9 +53,8 @@ LLVM_DUMP_METHOD void PHITransAddr::dump() const {
}
#endif
-
-static bool VerifySubExpr(Value *Expr,
- SmallVectorImpl<Instruction*> &InstInputs) {
+static bool verifySubExpr(Value *Expr,
+ SmallVectorImpl<Instruction *> &InstInputs) {
// If this is a non-instruction value, there is nothing to do.
Instruction *I = dyn_cast<Instruction>(Expr);
if (!I) return true;
@@ -70,30 +69,30 @@ static bool VerifySubExpr(Value *Expr,
// If it isn't in the InstInputs list it is a subexpr incorporated into the
// address. Validate that it is phi translatable.
- if (!CanPHITrans(I)) {
+ if (!canPHITrans(I)) {
errs() << "Instruction in PHITransAddr is not phi-translatable:\n";
errs() << *I << '\n';
llvm_unreachable("Either something is missing from InstInputs or "
- "CanPHITrans is wrong.");
+ "canPHITrans is wrong.");
}
// Validate the operands of the instruction.
for (unsigned i = 0, e = I->getNumOperands(); i != e; ++i)
- if (!VerifySubExpr(I->getOperand(i), InstInputs))
+ if (!verifySubExpr(I->getOperand(i), InstInputs))
return false;
return true;
}
-/// Verify - Check internal consistency of this data structure. If the
+/// verify - Check internal consistency of this data structure. If the
/// structure is valid, it returns true. If invalid, it prints errors and
/// returns false.
-bool PHITransAddr::Verify() const {
+bool PHITransAddr::verify() const {
if (!Addr) return true;
SmallVector<Instruction*, 8> Tmp(InstInputs.begin(), InstInputs.end());
- if (!VerifySubExpr(Addr, Tmp))
+ if (!verifySubExpr(Addr, Tmp))
return false;
if (!Tmp.empty()) {
@@ -107,18 +106,16 @@ bool PHITransAddr::Verify() const {
return true;
}
-
-/// IsPotentiallyPHITranslatable - If this needs PHI translation, return true
+/// isPotentiallyPHITranslatable - If this needs PHI translation, return true
/// if we have some hope of doing it. This should be used as a filter to
/// avoid calling PHITranslateValue in hopeless situations.
-bool PHITransAddr::IsPotentiallyPHITranslatable() const {
+bool PHITransAddr::isPotentiallyPHITranslatable() const {
// If the input value is not an instruction, or if it is not defined in CurBB,
// then we don't need to phi translate it.
Instruction *Inst = dyn_cast<Instruction>(Addr);
- return !Inst || CanPHITrans(Inst);
+ return !Inst || canPHITrans(Inst);
}
-
static void RemoveInstInputs(Value *V,
SmallVectorImpl<Instruction*> &InstInputs) {
Instruction *I = dyn_cast<Instruction>(V);
@@ -140,9 +137,9 @@ static void RemoveInstInputs(Value *V,
}
}
-Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
- BasicBlock *PredBB,
- const DominatorTree *DT) {
+Value *PHITransAddr::translateSubExpr(Value *V, BasicBlock *CurBB,
+ BasicBlock *PredBB,
+ const DominatorTree *DT) {
// If this is a non-instruction value, it can't require PHI translation.
Instruction *Inst = dyn_cast<Instruction>(V);
if (!Inst) return V;
@@ -166,11 +163,11 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
// If this is a PHI, go ahead and translate it.
if (PHINode *PN = dyn_cast<PHINode>(Inst))
- return AddAsInput(PN->getIncomingValueForBlock(PredBB));
+ return addAsInput(PN->getIncomingValueForBlock(PredBB));
// If this is a non-phi value, and it is analyzable, we can incorporate it
// into the expression by making all instruction operands be inputs.
- if (!CanPHITrans(Inst))
+ if (!canPHITrans(Inst))
return nullptr;
// All instruction operands are now inputs (and of course, they may also be
@@ -186,7 +183,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
if (CastInst *Cast = dyn_cast<CastInst>(Inst)) {
if (!isSafeToSpeculativelyExecute(Cast)) return nullptr;
- Value *PHIIn = PHITranslateSubExpr(Cast->getOperand(0), CurBB, PredBB, DT);
+ Value *PHIIn = translateSubExpr(Cast->getOperand(0), CurBB, PredBB, DT);
if (!PHIIn) return nullptr;
if (PHIIn == Cast->getOperand(0))
return Cast;
@@ -195,8 +192,8 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
// Constants are trivial to find.
if (Constant *C = dyn_cast<Constant>(PHIIn))
- return AddAsInput(ConstantExpr::getCast(Cast->getOpcode(),
- C, Cast->getType()));
+ return addAsInput(
+ ConstantExpr::getCast(Cast->getOpcode(), C, Cast->getType()));
// Otherwise we have to see if a casted version of the incoming pointer
// is available. If so, we can use it, otherwise we have to fail.
@@ -215,7 +212,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
SmallVector<Value*, 8> GEPOps;
bool AnyChanged = false;
for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) {
- Value *GEPOp = PHITranslateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT);
+ Value *GEPOp = translateSubExpr(GEP->getOperand(i), CurBB, PredBB, DT);
if (!GEPOp) return nullptr;
AnyChanged |= GEPOp != GEP->getOperand(i);
@@ -232,7 +229,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
for (unsigned i = 0, e = GEPOps.size(); i != e; ++i)
RemoveInstInputs(GEPOps[i], InstInputs);
- return AddAsInput(V);
+ return addAsInput(V);
}
// Scan to see if we have this GEP available.
@@ -259,7 +256,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
bool isNSW = cast<BinaryOperator>(Inst)->hasNoSignedWrap();
bool isNUW = cast<BinaryOperator>(Inst)->hasNoUnsignedWrap();
- Value *LHS = PHITranslateSubExpr(Inst->getOperand(0), CurBB, PredBB, DT);
+ Value *LHS = translateSubExpr(Inst->getOperand(0), CurBB, PredBB, DT);
if (!LHS) return nullptr;
// If the PHI translated LHS is an add of a constant, fold the immediates.
@@ -273,7 +270,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
// If the old 'LHS' was an input, add the new 'LHS' as an input.
if (is_contained(InstInputs, BOp)) {
RemoveInstInputs(BOp, InstInputs);
- AddAsInput(LHS);
+ addAsInput(LHS);
}
}
@@ -282,7 +279,7 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
// If we simplified the operands, the LHS is no longer an input, but Res
// is.
RemoveInstInputs(LHS, InstInputs);
- return AddAsInput(Res);
+ return addAsInput(Res);
}
// If we didn't modify the add, just return it.
@@ -306,21 +303,19 @@ Value *PHITransAddr::PHITranslateSubExpr(Value *V, BasicBlock *CurBB,
return nullptr;
}
-
/// PHITranslateValue - PHI translate the current address up the CFG from
/// CurBB to Pred, updating our state to reflect any needed changes. If
/// 'MustDominate' is true, the translated value must dominate
/// PredBB. This returns true on failure and sets Addr to null.
-bool PHITransAddr::PHITranslateValue(BasicBlock *CurBB, BasicBlock *PredBB,
- const DominatorTree *DT,
- bool MustDominate) {
+bool PHITransAddr::translateValue(BasicBlock *CurBB, BasicBlock *PredBB,
+ const DominatorTree *DT, bool MustDominate) {
assert(DT || !MustDominate);
- assert(Verify() && "Invalid PHITransAddr!");
+ assert(verify() && "Invalid PHITransAddr!");
if (DT && DT->isReachableFromEntry(PredBB))
- Addr = PHITranslateSubExpr(Addr, CurBB, PredBB, DT);
+ Addr = translateSubExpr(Addr, CurBB, PredBB, DT);
else
Addr = nullptr;
- assert(Verify() && "Invalid PHITransAddr!");
+ assert(verify() && "Invalid PHITransAddr!");
if (MustDominate)
// Make sure the value is live in the predecessor.
@@ -338,14 +333,14 @@ bool PHITransAddr::PHITranslateValue(BasicBlock *CurBB, BasicBlock *PredBB,
/// All newly created instructions are added to the NewInsts list. This
/// returns null on failure.
///
-Value *PHITransAddr::
-PHITranslateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB,
- const DominatorTree &DT,
- SmallVectorImpl<Instruction*> &NewInsts) {
+Value *
+PHITransAddr::translateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB,
+ const DominatorTree &DT,
+ SmallVectorImpl<Instruction *> &NewInsts) {
unsigned NISize = NewInsts.size();
// Attempt to PHI translate with insertion.
- Addr = InsertPHITranslatedSubExpr(Addr, CurBB, PredBB, DT, NewInsts);
+ Addr = insertTranslatedSubExpr(Addr, CurBB, PredBB, DT, NewInsts);
// If successful, return the new value.
if (Addr) return Addr;
@@ -356,20 +351,18 @@ PHITranslateWithInsertion(BasicBlock *CurBB, BasicBlock *PredBB,
return nullptr;
}
-
-/// InsertPHITranslatedPointer - Insert a computation of the PHI translated
+/// insertTranslatedSubExpr - Insert a computation of the PHI translated
/// version of 'V' for the edge PredBB->CurBB into the end of the PredBB
/// block. All newly created instructions are added to the NewInsts list.
/// This returns null on failure.
///
-Value *PHITransAddr::
-InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
- BasicBlock *PredBB, const DominatorTree &DT,
- SmallVectorImpl<Instruction*> &NewInsts) {
+Value *PHITransAddr::insertTranslatedSubExpr(
+ Value *InVal, BasicBlock *CurBB, BasicBlock *PredBB,
+ const DominatorTree &DT, SmallVectorImpl<Instruction *> &NewInsts) {
// See if we have a version of this value already available and dominating
// PredBB. If so, there is no need to insert a new instance of it.
PHITransAddr Tmp(InVal, DL, AC);
- if (!Tmp.PHITranslateValue(CurBB, PredBB, &DT, /*MustDominate=*/true))
+ if (!Tmp.translateValue(CurBB, PredBB, &DT, /*MustDominate=*/true))
return Tmp.getAddr();
// We don't need to PHI translate values which aren't instructions.
@@ -380,8 +373,8 @@ InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
// Handle cast of PHI translatable value.
if (CastInst *Cast = dyn_cast<CastInst>(Inst)) {
if (!isSafeToSpeculativelyExecute(Cast)) return nullptr;
- Value *OpVal = InsertPHITranslatedSubExpr(Cast->getOperand(0),
- CurBB, PredBB, DT, NewInsts);
+ Value *OpVal = insertTranslatedSubExpr(Cast->getOperand(0), CurBB, PredBB,
+ DT, NewInsts);
if (!OpVal) return nullptr;
// Otherwise insert a cast at the end of PredBB.
@@ -398,8 +391,8 @@ InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
SmallVector<Value*, 8> GEPOps;
BasicBlock *CurBB = GEP->getParent();
for (unsigned i = 0, e = GEP->getNumOperands(); i != e; ++i) {
- Value *OpVal = InsertPHITranslatedSubExpr(GEP->getOperand(i),
- CurBB, PredBB, DT, NewInsts);
+ Value *OpVal = insertTranslatedSubExpr(GEP->getOperand(i), CurBB, PredBB,
+ DT, NewInsts);
if (!OpVal) return nullptr;
GEPOps.push_back(OpVal);
}
@@ -422,8 +415,8 @@ InsertPHITranslatedSubExpr(Value *InVal, BasicBlock *CurBB,
// This needs to be evaluated carefully to consider its cost trade offs.
// PHI translate the LHS.
- Value *OpVal = InsertPHITranslatedSubExpr(Inst->getOperand(0),
- CurBB, PredBB, DT, NewInsts);
+ Value *OpVal = insertTranslatedSubExpr(Inst->getOperand(0), CurBB, PredBB,
+ DT, NewInsts);
if (OpVal == nullptr)
return nullptr;
diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
index 9c0b4d6731459..bff4bcc543039 100644
--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp
@@ -462,10 +462,10 @@ memoryIsNotModifiedBetween(Instruction *FirstI, Instruction *SecondI,
"Should not hit the entry block because SI must be dominated by LI");
for (BasicBlock *Pred : predecessors(B)) {
PHITransAddr PredAddr = Addr;
- if (PredAddr.NeedsPHITranslationFromBlock(B)) {
- if (!PredAddr.IsPotentiallyPHITranslatable())
+ if (PredAddr.needsPHITranslationFromBlock(B)) {
+ if (!PredAddr.isPotentiallyPHITranslatable())
return false;
- if (PredAddr.PHITranslateValue(B, Pred, DT, false))
+ if (PredAddr.translateValue(B, Pred, DT, false))
return false;
}
Value *TranslatedPtr = PredAddr.getAddr();
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 1265bed2577a2..4a101217e8eaa 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -1556,8 +1556,8 @@ bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
BasicBlock *Cur = Load->getParent();
while (Cur != LoadBB) {
PHITransAddr Address(LoadPtr, DL, AC);
- LoadPtr = Address.PHITranslateWithInsertion(
- Cur, Cur->getSinglePredecessor(), *DT, NewInsts);
+ LoadPtr = Address.translateWithInsertion(Cur, Cur->getSinglePredecessor(),
+ *DT, NewInsts);
if (!LoadPtr) {
CanDoPRE = false;
break;
@@ -1567,8 +1567,8 @@ bool GVNPass::PerformLoadPRE(LoadInst *Load, AvailValInBlkVect &ValuesPerBlock,
if (LoadPtr) {
PHITransAddr Address(LoadPtr, DL, AC);
- LoadPtr = Address.PHITranslateWithInsertion(LoadBB, UnavailablePred, *DT,
- NewInsts);
+ LoadPtr = Address.translateWithInsertion(LoadBB, UnavailablePred, *DT,
+ NewInsts);
}
// If we couldn't find or insert a computation of this phi translated value,
// we fail PRE.
More information about the llvm-commits
mailing list