Closed nikic closed 1 week ago
@llvm/pr-subscribers-llvm-ir
Author: Nikita Popov (nikic)
@llvm/pr-subscribers-llvm-transforms
Author: Nikita Popov (nikic)
:white_check_mark: With the latest revision this PR passed the C/C++ code formatter.
instead of computeKnownBits().
Does it improve the compile-time?
instead of computeKnownBits().
Does it improve the compile-time?
I don't see any significant compile-time change: https://llvm-compile-time-tracker.com/compare.php?from=e1622e189e8c0ef457bfac528f90a7a930d9aad2&to=b48d51be8e5956645d323123550638ba911eef69&stat=instructions:u
We should handle icmp pred (trunc nsw/nuw X), C
first to avoid regression https://github.com/dtcxzyw/llvm-opt-benchmark/pull/567/files#r1583426017.
We should handle
icmp pred (trunc nsw/nuw X), C
first to avoid regression https://github.com/dtcxzyw/llvm-opt-benchmark/pull/567/files#r1583426017.
There is a PR for that one already here: https://github.com/llvm/llvm-project/pull/87935
Convert the existing foldICmpTruncWithTruncOrExt() fold to work with trunc nowrap flags instead of computeKnownBits(). This also allows us to generalize the fold to work with signed comparisons.
Interestingly, apart from the obvious combinations like signed predicates with trunc nsw, some non-obvious ones are also legal. For example for unsigned predicates we can do the transform for two trunc nsw as well (rather than only trunc nuw).
Proofs: https://alive2.llvm.org/ce/z/ndewwK