diff options
author | Vigneshwar Jayakumar <vigneshwar.jayakumar@amd.com> | 2025-07-25 15:23:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-07-25 15:23:45 -0500 |
commit | 56ae79a6ab70ded92846e053b13745ea51e48089 (patch) | |
tree | d4afcba58ea0b5f23a53663988061567970061e0 /llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp | |
parent | 5ebdfe386e3bb9f959719f76a9ad689f843c2164 (diff) | |
download | llvm-56ae79a6ab70ded92846e053b13745ea51e48089.zip llvm-56ae79a6ab70ded92846e053b13745ea51e48089.tar.gz llvm-56ae79a6ab70ded92846e053b13745ea51e48089.tar.bz2 |
reland "[StructurizeCFG] Hoist and simplify zero-cost incoming else p… (#149744)
…hi values (#139605)"
This relands commit b11523b494b with the fix for llvm-buildbot failures
"clang-hip-vega20" and "openmp-offload-amdgpu-runtime-2". The reland
prevents hoisting the phi node which fixes the issue.
Original PR description:
The order of if and else blocks can introduce unnecessary VGPR copies.
Consider the case of an if-else block where the incoming phi from the
'Else block' only contains zero-cost instructions, and the 'Then' block
modifies some value. There would be no interference when coalescing
because only one value is live at any point before structurization.
However, in the structurized CFG, the Then value is live at 'Else' block
due to the path if→flow→else, leading to additional VGPR copies.
This patch addresses the issue by:
- Identifying PHI nodes with zero-cost incoming values from the Else
block and hoisting those values to the nearest common dominator of the
Then and Else blocks.
- Updating Flow PHI nodes by replacing poison entries (on the if→flow
edge) with the correct hoisted values.
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/ThreadSafeModuleTest.cpp')
0 files changed, 0 insertions, 0 deletions