[llvm] [X86] Fold some (setcc (sub (truncate (srl (add X, C1), C2)), C3), CC) patterns to (setcc (cmp (add (truncate (srl X, C2)), C1'), C3), CC) (PR #126448)
João Gouveia via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 12 13:42:14 PST 2025
joaotgouveia wrote:
I've changed the fold to make it more general: https://alive2.llvm.org/ce/z/F3oLAg
It looks like a potentially unnecessary `MOVZ` is being generated (https://github.com/llvm/llvm-project/pull/126448/commits/b773400981d8ca97de016f6acbe02e71b30b5779#diff-087ad9d10d1a1ef9414f8bf9111fef0b4983cebe3a1f17a20accf492790b40c0L41-R44, for example). Considering this is also noticeable here https://godbolt.org/z/jTT99GrGK, I'm guessing this is a separate issue?
Regarding the TODO comment on i64 math (https://github.com/llvm/llvm-project/pull/126448/commits/b773400981d8ca97de016f6acbe02e71b30b5779#diff-eb2f176d67cdf1955a90e71e25d6d39910d723d4e0b8a9bf8dfa229d3a6b2c1eR53685-R53686), should I remove it entirely?
https://github.com/llvm/llvm-project/pull/126448
More information about the llvm-commits
mailing list