Peeling assumed this doesn't happen, but didn't check it.
This fixes PR32178.
Differential D30757
[LoopUnroll] Don't peel loops where the latch isn't the exiting block mkuper on Mar 8 2017, 2:23 PM. Authored by
Details Peeling assumed this doesn't happen, but didn't check it. This fixes PR32178.
Diff Detail
Event TimelineComment Actions Looks good to me, but, as you noticed in the PR - do we want to work with such loops at all? Did you check what happens if we just bail out on such loops? Michael Comment Actions No, but I'm tempted to, because I think we have more bugs related to irreducible control flow that this patch doesn't fix. Do you know if we already have a utility somewhere that detects this? There's no way to get this information out of LoopInfo that I'm aware of. Comment Actions
Can we require the loop to be in a simplified form and its latch to be exiting? Will it suffice? Comment Actions Maybe? It will certainly squash this bug, not sure about the others. Comment Actions This version looks good to me too. MichaelZ PS: Can we have a similar problem in the regular loop unrolling?
Comment Actions Thanks! Re the PS - I don't know.
|