-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[XLA] Fix a miscompilation during loop constant sinking if the same b…
…ody computation was shared by multiple while loops. The current code assumes that a while loop's body is not shared with any other while loop. It is incorrect to sink a constant from one while loop into a body shared with multiple loops (or indeed, with other non-while instructions). It is hard to construct such a while loop with the current XlaBuilder API, which is why we have not noticed this bug until now, but it is certainly possible to do so. Fix the problem by cloning the body/conditional computations if they need to be modified. To correctly traverse the module in the presence of cloning, also fix a long-standing TODO and traverse the module recursively from the entry computation to the leaves. PiperOrigin-RevId: 689376769
- Loading branch information
1 parent
086726f
commit a6eeef2
Showing
4 changed files
with
160 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters