[PATCH] D132337: [NFC] LoopAccess: Move expressions close to usage
Aditya Kumar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 23 07:09:12 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG0af3ab02fd83: [NFC] LoopAccess: Move expressions close to usage (authored by hiraditya).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132337/new/
https://reviews.llvm.org/D132337
Files:
llvm/lib/Analysis/LoopAccessAnalysis.cpp
Index: llvm/lib/Analysis/LoopAccessAnalysis.cpp
===================================================================
--- llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -286,8 +286,6 @@
return;
}
- const DataLayout &DL =
- SinkAR->getLoop()->getHeader()->getModule()->getDataLayout();
SmallVector<Instruction *, 4> SrcInsts =
DC.getInstructionsForAccess(Src->PointerValue, Src->IsWritePtr);
SmallVector<Instruction *, 4> SinkInsts =
@@ -298,11 +296,10 @@
CanUseDiffCheck = false;
return;
}
+ const DataLayout &DL =
+ SinkAR->getLoop()->getHeader()->getModule()->getDataLayout();
unsigned AllocSize =
std::max(DL.getTypeAllocSize(SrcTy), DL.getTypeAllocSize(DstTy));
- IntegerType *IntTy =
- IntegerType::get(Src->PointerValue->getContext(),
- DL.getPointerSizeInBits(CGI.AddressSpace));
// Only matching constant steps matching the AllocSize are supported at the
// moment. This simplifies the difference computation. Can be extended in the
@@ -314,6 +311,10 @@
return;
}
+ IntegerType *IntTy =
+ IntegerType::get(Src->PointerValue->getContext(),
+ DL.getPointerSizeInBits(CGI.AddressSpace));
+
// When counting down, the dependence distance needs to be swapped.
if (Step->getValue()->isNegative())
std::swap(SinkAR, SrcAR);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132337.454832.patch
Type: text/x-patch
Size: 1408 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220823/8c783d4b/attachment.bin>
More information about the llvm-commits
mailing list