[all-commits] [llvm/llvm-project] 186c90: [InstCombine] Expand redundant phi cycle eliminati...
David Green via All-commits
all-commits at lists.llvm.org
Wed Oct 4 01:34:42 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 186c9079d418c5ccf4920fec9540240b630914ba
https://github.com/llvm/llvm-project/commit/186c9079d418c5ccf4920fec9540240b630914ba
Author: David Green <david.green at arm.com>
Date: 2023-10-04 (Wed, 04 Oct 2023)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
M llvm/test/Transforms/InstCombine/phi.ll
Log Message:
-----------
[InstCombine] Expand redundant phi cycle elimination (#67968)
There is a combine in instcombine that will look for phi cycles that only have
a single incoming value:
```
%0 = phi i64 [ %3, %exit ], [ %othervalue, %preheader ]
%3 = phi i64 [ %0, %body ], [ %othervalue, %body2 ]
```
This currently doesn't handle if %othervalue is a phi though, as the algorithm
will recurse into the phi and fail with multiple incoming values. This adjusts
the algorithm, not requiring the initial value to be found immediately,
allowing it to be set to the value of one of the phis that would otherwise fail
due to having multiple input values.
More information about the All-commits
mailing list