aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorMax Kazantsev <mkazantsev@azul.com>2023-02-27 18:22:52 +0700
committerMax Kazantsev <mkazantsev@azul.com>2023-02-27 18:26:17 +0700
commita18ce47a3e0065d0a26b370a73440411b76d8493 (patch)
tree4e04373a9fcc712c133d09b71ac785c28501b04c /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentee2f9d6dfb6f1360d2dc68d151c84e80252a40ec (diff)
downloadllvm-a18ce47a3e0065d0a26b370a73440411b76d8493.zip
llvm-a18ce47a3e0065d0a26b370a73440411b76d8493.tar.gz
llvm-a18ce47a3e0065d0a26b370a73440411b76d8493.tar.bz2
[LoopPredication] Account for critical edges when inserting assumes. PR26496
Loop predication can insert assumes to preserve knowledge about some facts that may otherwise be lost, because loop predication is a lossy transform. When a guard is represented as branch by widenable condition, it should insert it in the guarded block. However, if the guarded block has other predecessors than the guard block, then the condition might not dominate it. Currently we generate invalid code here. One possible fix here is to split critical edge and insert the assume there, but in this case we should modify CFG, which Loop Predication is not currently doing, and we want to keep it that way. The fix is to handle this case by inserting a Phi which takes `Cond` as input from the guard block and `true` from any other blocks. This is valid in terms of IR and does not introduce any new knowledge if we came from another block. Differential Revision: https://reviews.llvm.org/D144859 Reviewed By: nikic, skatkov
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions