[llvm] [LoopFusion] Validate loop structure before creating LoopCandidates (PR #192280)
Ehsan Amiri via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 15 10:13:35 PDT 2026
================
@@ -363,7 +363,9 @@ struct FusionCandidate {
bool reportInvalidCandidate(Statistic &Stat) const {
using namespace ore;
- assert(L && Preheader && "Fusion candidate not initialized properly!");
+ assert(L && "Fusion candidate has null loop!");
+ if (!Preheader)
+ return false;
----------------
amehsan wrote:
This should remain an assert. The assert just tells us that we assume at this point we have a valid loop that has a preheader. If our assumption fails to be correct we want the compiler crash so we know what we missed.
We are not checking anything here. Checks for preheader should be done elsewhere.
https://github.com/llvm/llvm-project/pull/192280
More information about the llvm-commits
mailing list