[llvm] f50821c - [LoopFuse] Add assertion for non-null DT in fusion candidate

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 1 14:00:27 PST 2022


Author: Anna Thomas
Date: 2022-02-01T17:00:09-05:00
New Revision: f50821cff048209bfb98991b978c87cf24d37904

URL: https://github.com/llvm/llvm-project/commit/f50821cff048209bfb98991b978c87cf24d37904
DIFF: https://github.com/llvm/llvm-project/commit/f50821cff048209bfb98991b978c87cf24d37904.diff

LOG: [LoopFuse] Add assertion for non-null DT in fusion candidate

The code paths analyzed (all constructor invocations of fusion
candidate) pass in a non-null DT.
Adding this assert as requested in D118472 before converting this to a
reference argument.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LoopFuse.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index 81a7b2ee4f51..bf4d275e04ba 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -192,6 +192,7 @@ struct FusionCandidate {
         GuardBranch(L->getLoopGuardBranch()), PP(PP), AbleToPeel(canPeel(L)),
         Peeled(false), DT(DT), PDT(PDT), ORE(ORE) {
 
+    assert(DT && "Expected non-null DT!");
     // Walk over all blocks in the loop and check for conditions that may
     // prevent fusion. For each block, walk over all instructions and collect
     // the memory reads and writes If any instructions that prevent fusion are


        


More information about the llvm-commits mailing list