- Fix the case where more than 1 common instructions derived from the same operand cannot be sunk
Details
Details
- Reviewers
nadav
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Hi Nadav & Manman
Could you help me reviewing the fix of common code sinking in SimplifyCFG?
Yours
- Michael
Comment Actions
The existing common code sinking in SimplifyCFG maintains a mapping from BB1 value to BB2 value pairing the phi node. This prevents case where a single value has two or more derived values in both if and else branches as, once one derived is sunk, that single value is added into that map and prevent further sinking. The added test reveal that issue. With the existing implementation, only one function call could be sunk instead of both. After the fix, both function calls are sunk. The fix changes the BB1->BB2 pairing phi map with a (BB1,BB2) -> phi map, which is more accurate to track the common code.
Yours
- Michael