[llvm] AMDGPU: fix isSafeToSink expecting exactly one predecessor (PR #89224)
Jay Foad via llvm-commits
llvm-commits at lists.llvm.org
Thu May 9 07:46:11 PDT 2024
================
@@ -213,17 +213,20 @@ bool SIInstrInfo::isSafeToSink(MachineInstr &MI,
// Check if there is a FromCycle that contains SgprDef's basic block but
// does not contain SuccToSinkTo and also has divergent exit condition.
while (FromCycle && !FromCycle->contains(ToCycle)) {
- // After structurize-cfg, there should be exactly one cycle exit.
+ // After structurize-cfg, there should be exactly one cycle exit. Also,
+ // cycle exit block should have exactly one predecessor, the cycle exit.
+ // Early-tailduplication can removed that block so we have to search for
+ // predecessor that is in cycle.
----------------
jayfoad wrote:
`LoopInfo` has `getExitingBlocks` but `CycleInfo` does not.
I would be happy with removing the comment but @ssahasra suggested to keep it.
https://github.com/llvm/llvm-project/pull/89224
More information about the llvm-commits
mailing list