[PATCH] D104620: [LoopVersioning] Add utility to fetch the runtime check basic block
Yueh-Ting Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 21 00:25:56 PDT 2021
eopXD updated this revision to Diff 353286.
eopXD added a comment.
Update the code.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104620/new/
https://reviews.llvm.org/D104620
Files:
llvm/include/llvm/Transforms/Utils/LoopVersioning.h
llvm/lib/Transforms/Utils/LoopVersioning.cpp
Index: llvm/lib/Transforms/Utils/LoopVersioning.cpp
===================================================================
--- llvm/lib/Transforms/Utils/LoopVersioning.cpp
+++ llvm/lib/Transforms/Utils/LoopVersioning.cpp
@@ -58,7 +58,7 @@
Value *RuntimeCheck = nullptr;
// Add the memcheck in the original preheader (this is empty initially).
- BasicBlock *RuntimeCheckBB = VersionedLoop->getLoopPreheader();
+ RuntimeCheckBB = VersionedLoop->getLoopPreheader();
const auto &RtPtrChecking = *LAI.getRuntimePointerChecking();
SCEVExpander Exp2(*RtPtrChecking.getSE(),
Index: llvm/include/llvm/Transforms/Utils/LoopVersioning.h
===================================================================
--- llvm/include/llvm/Transforms/Utils/LoopVersioning.h
+++ llvm/include/llvm/Transforms/Utils/LoopVersioning.h
@@ -75,6 +75,9 @@
/// loop may alias (i.e. one of the memchecks failed).
Loop *getNonVersionedLoop() { return NonVersionedLoop; }
+ /// Returns the basic block that contains the runtime check BranchInst
+ BasicBlock *getRuntimeCheckBB() { return RuntimeCheckBB; }
+
/// Annotate memory instructions in the versioned loop with no-alias
/// metadata based on the memchecks issued.
///
@@ -115,6 +118,9 @@
/// loop may alias (memchecks failed).
Loop *NonVersionedLoop;
+ /// The basic Block that stores the BranchInst to Versioned / NonVersioned
+ BasicBlock *RuntimeCheckBB;
+
/// This maps the instructions from VersionedLoop to their counterpart
/// in NonVersionedLoop.
ValueToValueMapTy VMap;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104620.353286.patch
Type: text/x-patch
Size: 1554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210621/ce920c73/attachment.bin>
More information about the llvm-commits
mailing list