Hoist loop-invariant if out of while#2586
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2586 +/- ##
==========================================
+ Coverage 31.07% 31.08% +0.01%
==========================================
Files 225 225
Lines 44504 44509 +5
==========================================
+ Hits 13830 13837 +7
+ Misses 30674 30672 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pangoraw
left a comment
There was a problem hiding this comment.
lgtm, maybe add it here
if out of whileif out of while
wsmoses
left a comment
There was a problem hiding this comment.
lgtm, lets try to get this and the other ones merged together quickly
|
I'm afk now but can try merge, and revise the other one later today or early tomorrow |
|
unclear which comment is preventing merging here, I clicked resolve on all of them but still seeing "Merging is blocked due to pending merge requirements" |
|
fair 😅 |
|
Sorry I lost track of this (again). I tried a bit reproducing the TPU issue on Hydra, without success. The macos failure seems to be because of this patch in XLA_PATCHES in Claude proposes replacing this with: I'm not sure if this is sensical, and these patches seem to be introduced by enzymead-bot. I'm not really familiar with how all this works. |
|
Merging this one, let's track the CI failure separately. |

This pass transforms a while loop containing an if-else operation, into an if-else operation where each branch contains the while loop. This fires when the condition of the if-statement is loop-invariant.
On the code in EnzymeAD/Reactant.jl#2907 this manages to move the if out by one level, but that doesn't seem to be enough for further raising.