[polly] r261475 - [Refactor] Avoid variables with name of types
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 21 08:36:21 PST 2016
Author: jdoerfert
Date: Sun Feb 21 10:36:21 2016
New Revision: 261475
URL: http://llvm.org/viewvc/llvm-project?rev=261475&view=rev
Log:
[Refactor] Avoid variables with name of types
Modified:
polly/trunk/include/polly/ScopInfo.h
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/include/polly/ScopInfo.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopInfo.h?rev=261475&r1=261474&r2=261475&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopInfo.h (original)
+++ polly/trunk/include/polly/ScopInfo.h Sun Feb 21 10:36:21 2016
@@ -2181,23 +2181,23 @@ class ScopInfo : public RegionPass {
ArrayRef<const SCEV *> Subscripts,
ArrayRef<const SCEV *> Sizes, Value *AccessValue);
- /// @brief Create a MemoryAccess for writing an llvm::Value.
+ /// @brief Create a MemoryAccess for writing an llvm::Instruction.
///
- /// The access will be created at the @p Value's definition.
+ /// The access will be created at the position of @p Inst.
///
- /// @param Value The value to be written.
+ /// @param Inst The instruction to be written.
/// @see ensureValueRead()
/// @see ScopArrayInfo::MemoryKind
- void ensureValueWrite(Instruction *Value);
+ void ensureValueWrite(Instruction *Inst);
/// @brief Ensure an llvm::Value is available in the BB's statement, creating
/// a MemoryAccess for reloading it if necessary.
///
- /// @param Value The value expected to be loaded.
+ /// @param V The value expected to be loaded.
/// @param UserBB Where to reload the value.
/// @see ensureValueStore()
/// @see ScopArrayInfo::MemoryKind
- void ensureValueRead(Value *Value, BasicBlock *UserBB);
+ void ensureValueRead(Value *V, BasicBlock *UserBB);
/// @brief Create a write MemoryAccess for the incoming block of a phi node.
///
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=261475&r1=261474&r2=261475&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Feb 21 10:36:21 2016
@@ -4056,45 +4056,44 @@ void ScopInfo::addArrayAccess(MemAccInst
ElemBytes, IsAffine, AccessValue, Subscripts, Sizes,
ScopArrayInfo::MK_Array);
}
-void ScopInfo::ensureValueWrite(Instruction *Value) {
- ScopStmt *Stmt = scop->getStmtForBasicBlock(Value->getParent());
+void ScopInfo::ensureValueWrite(Instruction *Inst) {
+ ScopStmt *Stmt = scop->getStmtForBasicBlock(Inst->getParent());
- // Value not defined within this SCoP.
+ // Inst not defined within this SCoP.
if (!Stmt)
return;
- // Do not process further if the value is already written.
- if (Stmt->lookupValueWriteOf(Value))
+ // Do not process further if the instruction is already written.
+ if (Stmt->lookupValueWriteOf(Inst))
return;
- addMemoryAccess(Value->getParent(), Value, MemoryAccess::MUST_WRITE, Value, 1,
- true, Value, ArrayRef<const SCEV *>(),
+ addMemoryAccess(Inst->getParent(), Inst, MemoryAccess::MUST_WRITE, Inst, 1,
+ true, Inst, ArrayRef<const SCEV *>(),
ArrayRef<const SCEV *>(), ScopArrayInfo::MK_Value);
}
-void ScopInfo::ensureValueRead(Value *Value, BasicBlock *UserBB) {
+void ScopInfo::ensureValueRead(Value *V, BasicBlock *UserBB) {
// There cannot be an "access" for literal constants. BasicBlock references
// (jump destinations) also never change.
- if ((isa<Constant>(Value) && !isa<GlobalVariable>(Value)) ||
- isa<BasicBlock>(Value))
+ if ((isa<Constant>(V) && !isa<GlobalVariable>(V)) || isa<BasicBlock>(V))
return;
// If the instruction can be synthesized and the user is in the region we do
// not need to add a value dependences.
Region &ScopRegion = scop->getRegion();
- if (canSynthesize(Value, LI, SE, &ScopRegion))
+ if (canSynthesize(V, LI, SE, &ScopRegion))
return;
// Do not build scalar dependences for required invariant loads as we will
// hoist them later on anyway or drop the SCoP if we cannot.
auto ScopRIL = SD->getRequiredInvariantLoads(&ScopRegion);
- if (ScopRIL->count(dyn_cast<LoadInst>(Value)))
+ if (ScopRIL->count(dyn_cast<LoadInst>(V)))
return;
// Determine the ScopStmt containing the value's definition and use. There is
// no defining ScopStmt if the value is a function argument, a global value,
// or defined outside the SCoP.
- Instruction *ValueInst = dyn_cast<Instruction>(Value);
+ Instruction *ValueInst = dyn_cast<Instruction>(V);
ScopStmt *ValueStmt =
ValueInst ? scop->getStmtForBasicBlock(ValueInst->getParent()) : nullptr;
@@ -4114,10 +4113,10 @@ void ScopInfo::ensureValueRead(Value *Va
// Do not create another MemoryAccess for reloading the value if one already
// exists.
- if (UserStmt->lookupValueReadOf(Value))
+ if (UserStmt->lookupValueReadOf(V))
return;
- addMemoryAccess(UserBB, nullptr, MemoryAccess::READ, Value, 1, true, Value,
+ addMemoryAccess(UserBB, nullptr, MemoryAccess::READ, V, 1, true, V,
ArrayRef<const SCEV *>(), ArrayRef<const SCEV *>(),
ScopArrayInfo::MK_Value);
if (ValueInst)
More information about the llvm-commits
mailing list