[PATCH] D144756: [SimplifyCFG] Do not hoist/sink convergent function calls

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 12:46:54 PST 2023


yaxunl created this revision.
yaxunl added reviewers: tra, mehdi_amini, rnk, nhaehnle.
Herald added a subscriber: hiraditya.
Herald added a project: All.
yaxunl requested review of this revision.
Herald added a project: LLVM.

Currently SimplifyCFG hoists/sink common instructions in then/else basic blocks
when certain options are enabled, which is the case for default clang optimization
pipelines for -O3. It tries to hoist/sink convergent function calls in divergent
control flow, which causes incorrect ISA generated for GPU, e.g.
 https://github.com/ROCm-Developer-Tools/HIP/issues/3172

This patch fixes that by conservatively disable hoisting/sinking common
convergent function calls in then/else blocks.


https://reviews.llvm.org/D144756

Files:
  llvm/lib/Transforms/Utils/SimplifyCFG.cpp
  llvm/test/Transforms/SimplifyCFG/convergent.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144756.500273.patch
Type: text/x-patch
Size: 6993 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230224/1e6904f5/attachment-0001.bin>


More information about the llvm-commits mailing list