diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-27 16:38:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-27 16:38:15 +0200 |
commit | 2d209d964a17687f70299d756a7b5e9fa342e0b4 (patch) | |
tree | 2d553fc73ebbda26ef1aca4e2d4684667fdd42ab /llvm/lib/Transforms/Utils/LoopVersioning.cpp | |
parent | 264197516495910588d19fb19b6793e9be1bd6a3 (diff) | |
download | llvm-2d209d964a17687f70299d756a7b5e9fa342e0b4.zip llvm-2d209d964a17687f70299d756a7b5e9fa342e0b4.tar.gz llvm-2d209d964a17687f70299d756a7b5e9fa342e0b4.tar.bz2 |
[IR] Add getDataLayout() helpers to BasicBlock and Instruction (#96902)
This is a helper to avoid writing `getModule()->getDataLayout()`. I
regularly try to use this method only to remember it doesn't exist...
`getModule()->getDataLayout()` is also a common (the most common?)
reason why code has to include the Module.h header.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopVersioning.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopVersioning.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopVersioning.cpp b/llvm/lib/Transforms/Utils/LoopVersioning.cpp index 548b0f3..c43c92a 100644 --- a/llvm/lib/Transforms/Utils/LoopVersioning.cpp +++ b/llvm/lib/Transforms/Utils/LoopVersioning.cpp @@ -62,19 +62,19 @@ void LoopVersioning::versionLoop( const auto &RtPtrChecking = *LAI.getRuntimePointerChecking(); SCEVExpander Exp2(*RtPtrChecking.getSE(), - VersionedLoop->getHeader()->getModule()->getDataLayout(), + VersionedLoop->getHeader()->getDataLayout(), "induction"); MemRuntimeCheck = addRuntimeChecks(RuntimeCheckBB->getTerminator(), VersionedLoop, AliasChecks, Exp2); - SCEVExpander Exp(*SE, RuntimeCheckBB->getModule()->getDataLayout(), + SCEVExpander Exp(*SE, RuntimeCheckBB->getDataLayout(), "scev.check"); SCEVRuntimeCheck = Exp.expandCodeForPredicate(&Preds, RuntimeCheckBB->getTerminator()); IRBuilder<InstSimplifyFolder> Builder( RuntimeCheckBB->getContext(), - InstSimplifyFolder(RuntimeCheckBB->getModule()->getDataLayout())); + InstSimplifyFolder(RuntimeCheckBB->getDataLayout())); if (MemRuntimeCheck && SCEVRuntimeCheck) { Builder.SetInsertPoint(RuntimeCheckBB->getTerminator()); RuntimeCheck = |