The new pass does not preserve the same set as the legacy pass and I've added FIXMEs to indicate what is missing.
Details
Diff Detail
Event Timeline
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
30 | mhm,did you forget LCSSA.h maybe? This doesn't build. |
Some comments (waiting for the header).
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
342 | else after return | |
348 | I'd put the comment just before the declaration of PA | |
test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll | ||
5–9 | This should really use FileCheck and not grep. Feel free to commit the change to the existing code separately. | |
test/Transforms/LCSSA/basictest.ll | ||
3 | Ditto. |
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
345 | This is a sore point. I think mustPreserveAnalysisID(LCSSAID) should become an assert in the new PM which verifies that the IR mutation didn't destroy LCSSA. |
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
345 | Could you elaborate on this a bit more? The current state is that loop transformation passes call mustPreserveAnalysisID(LCSSAID) to determine if LCSSA is available and ensures that the transformation preserves LCSSA by calling addPreserved. How will this look in the new PM? Incidentally, LoopSimplify (and a few others) do not actually call addPreservedID(LCSSAID). Isn't this a bug? | |
test/Transforms/LCSSA/2006-06-12-MultipleExitsSameBlock.ll | ||
5–9 | I committed r272065 that made the original tests use FileCheck |
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
345 | Sure.
What I think (and what I gathered from Chandler) is that in this case instead of caching we should just add a verifier pass which asserts LCSSA is maintained.
|
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
345 | To be clear: when I say LCSSA is not pure I mean the LCSSA pass in LLVM, not the canonical form per-se. Thanks! |
I'm good with the patch with the FIXME below removed, but you should circle back with Davide before landing.
lib/Transforms/Utils/LCSSA.cpp | ||
---|---|---|
345 | Sorry for not chiming in earlier, just now catching up on email. I feel like some of this discussion would be helped by re-reading the design discussion around the new pass manager. There is a fundamental difference regarding the new pass manager and the old pass manager when it comes to LCSSA and LoopSimplify. I'll try to summarize that here: The old pass manager uses the analysis preserved / requires machinery to *automatically* schedule the *transformation* passes LCSSA and LoopSimplify. This is incredibly magical and brittle. It breaks constantly and has proven nearly impossible to support. The new pass manager consequentially has *zero support for this*. The intent is that LCSSA and LoopSimplify will be canonicalizing transformation passes for loops. They'll be scheduled explicitly, and loop passes should detect and gracefully degrade behavior when loops are not simplified or not in LCSSA form. Transformations should still work to not *break* LCSSA because that is the desired form for loops. I understand that this result will be painful, but I think it is by far the less painful alternative to the current design. We spend much too much time fixing crashers that are hard to even test for because of the requires / preserves nonsense. I think the only realistic way to make LCSSA *required* (which seems desirable considering the cost of checking for it) is to make it *verifier required* which requires making Loops part of the IR the way Dominators are, etc, etc, etc. That's a huge project, and I don't think we want to try to do that right now. So ultimately, I don't think there is any FIXME needed here. |
mhm,did you forget LCSSA.h maybe? This doesn't build.