[all-commits] [llvm/llvm-project] ac4cb1: [X86] fold (and (mul x, c1), c2) -> (mul x, (and c...
Simon Pilgrim via All-commits
all-commits at lists.llvm.org
Tue Jun 21 07:11:08 PDT 2022
Author: Simon Pilgrim <llvm-dev at redking.me.uk>
Date: 2022-06-21 (Tue, 21 Jun 2022)
[X86] fold (and (mul x, c1), c2) -> (mul x, (and c1, c2)) iff c2 is all/no bits mask
Noticed on D128216 - if we're zeroing out vector elements of a mul/mulh result then see if we can merge the and-mask into the mul by just multiplying by zero.
Ideally we'd make this generic (similar to the existing foldSelectWithIdentityConstant?), but these cases are appearing very late, after the constants have been lowered to constant-pool loads.
More information about the All-commits