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();
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;
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);
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);
}