[PATCH] D94470: [LSR] Don't break a critical edge if parent ends with "callbr"
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 14:08:47 PST 2021
MaskRay added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:5594-5595
+
+ // Also bail out if we have a PHI with a value from a block ending in a
+ // CallBrInst, because those also can't be split for similar reasons.
+ for (BasicBlock *PredBB : PN->blocks())
----------------
void wrote:
> nickdesaulniers wrote:
> > Can this comment be made more precise, I don't think what's described is what's being tested?
> It's pretty accurate as is. :) I'm not sure how else to word it.
The change only affects `llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp`, not any codegen part, so I hope this can be tested with opt. Usually this should check the produced instructions.
If the resulting IR is correct but codegen somehow crashes, then it is probably a codegen bug which should be separately fixed. If the output IR is actually incorrect, then the IR verifier should be fixed instead.
Anyway I think the test should be added in an appropriate place and if this uncovers other issues those other issues should be reported as well.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94470/new/
https://reviews.llvm.org/D94470
More information about the llvm-commits
mailing list