diff options
author | Florian Hahn <flo@fhahn.com> | 2023-05-12 19:21:03 +0100 |
---|---|---|
committer | Florian Hahn <flo@fhahn.com> | 2023-05-12 19:21:03 +0100 |
commit | e351b9b66da088e5905ad3238ccf11e777943ead (patch) | |
tree | d2a592992999a6e23f371a2d9ae41e097af21e83 /llvm/lib/Support/StringRef.cpp | |
parent | dd02984519abafe7637cdafcf4ede8b303f385ab (diff) | |
download | llvm-e351b9b66da088e5905ad3238ccf11e777943ead.zip llvm-e351b9b66da088e5905ad3238ccf11e777943ead.tar.gz llvm-e351b9b66da088e5905ad3238ccf11e777943ead.tar.bz2 |
[EarlyIfCvt] Don't if-convert if condition has only loop-invariant ops.
This patch adds a heuristic to skip if-conversion if the condition has a
high chance of being predictable.
If the condition is in a loop, consider it predictable if the condition
itself or all its operands are loop-invariant. E.g. this considers a load
from a loop-invariant address predictable; we were unable to prove that it
doesn't alias any of the memory-writes in the loop, but it is likely to
read to same value multiple times.
This is a relatively crude heuristic, but it helps to prevent excessive
if-conversion in multiple workloads in practice.
Reviewed By: apostolakis
Differential Revision: https://reviews.llvm.org/D141639
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
0 files changed, 0 insertions, 0 deletions