[polly] r261994 - [MemAccInst] Introduce the '->' operator and remove the simple wrapper functions. NFC

Hongbin Zheng via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 01:47:11 PST 2016


Author: ether
Date: Fri Feb 26 03:47:11 2016
New Revision: 261994

URL: http://llvm.org/viewvc/llvm-project?rev=261994&view=rev
Log:
[MemAccInst] Introduce the '->' operator and remove the simple wrapper functions. NFC

Modified:
    polly/trunk/include/polly/Support/ScopHelper.h
    polly/trunk/lib/Analysis/ScopDetection.cpp
    polly/trunk/lib/Analysis/ScopInfo.cpp

Modified: polly/trunk/include/polly/Support/ScopHelper.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Support/ScopHelper.h?rev=261994&r1=261993&r2=261994&view=diff
==============================================================================
--- polly/trunk/include/polly/Support/ScopHelper.h (original)
+++ polly/trunk/include/polly/Support/ScopHelper.h Fri Feb 26 03:47:11 2016
@@ -150,26 +150,16 @@ public:
     return *this;
   }
 
+  llvm::Instruction *get() const {
+    assert(I && "Unexpected nullptr!");
+    return I;
+  }
   operator llvm::Instruction *() const { return asInstruction(); }
+  llvm::Instruction *operator->() const { return get(); }
+
   explicit operator bool() const { return isInstruction(); }
   bool operator!() const { return isNull(); }
 
-  llvm::Value *getOperand(unsigned i) const { return I->getOperand(i); }
-  llvm::BasicBlock *getParent() const { return I->getParent(); }
-  llvm::LLVMContext &getContext() const { return I->getContext(); }
-  void getAAMetadata(llvm::AAMDNodes &N, bool Merge = false) const {
-    I->getAAMetadata(N, Merge);
-  }
-
-  /// @brief Get the debug location of this instruction.
-  ///
-  /// @returns The debug location of this instruction.
-  const llvm::DebugLoc &getDebugLoc() const {
-    if (I)
-      return I->getDebugLoc();
-    llvm_unreachable("Operation not supported on nullptr");
-  }
-
   llvm::Value *getValueOperand() const {
     if (isLoad())
       return asLoad();

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=261994&r1=261993&r2=261994&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Fri Feb 26 03:47:11 2016
@@ -942,7 +942,7 @@ bool ScopDetection::isValidAccess(Instru
 bool ScopDetection::isValidMemoryAccess(MemAccInst Inst,
                                         DetectionContext &Context) const {
   Value *Ptr = Inst.getPointerOperand();
-  Loop *L = LI->getLoopFor(Inst.getParent());
+  Loop *L = LI->getLoopFor(Inst->getParent());
   const SCEV *AccessFunction = SE->getSCEVAtScope(Ptr, L);
   const SCEVUnknown *BasePointer;
 

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=261994&r1=261993&r2=261994&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Fri Feb 26 03:47:11 2016
@@ -3926,7 +3926,7 @@ bool ScopInfo::buildAccessMultiDimParam(
         cast<SCEVConstant>(Sizes.back())->getAPInt().getSExtValue();
     Sizes.pop_back();
     if (ElementSize != DelinearizedSize)
-      scop->invalidate(DELINEARIZATION, Inst.getDebugLoc());
+      scop->invalidate(DELINEARIZATION, Inst->getDebugLoc());
 
     addArrayAccess(Inst, Type, BasePointer->getValue(), ElementType, true,
                    AccItr->second.DelinearizedSubscripts, Sizes, Val);
@@ -4218,7 +4218,7 @@ void ScopInfo::addArrayAccess(MemAccInst
                               ArrayRef<const SCEV *> Sizes,
                               Value *AccessValue) {
   ArrayBasePointers.insert(BaseAddress);
-  addMemoryAccess(MemAccInst.getParent(), MemAccInst, AccType, BaseAddress,
+  addMemoryAccess(MemAccInst->getParent(), MemAccInst, AccType, BaseAddress,
                   ElementType, IsAffine, AccessValue, Subscripts, Sizes,
                   ScopArrayInfo::MK_Array);
 }




More information about the llvm-commits mailing list