[DAGCombiner] add fold for vselect based on mask of signbit, part 3
(Cond0 s> -1) ? N1 : 0 --> ~(Cond0 s>> BW-1) & N1 https://alive2.llvm.org/ce/z/mGCBrd This was suggested as a potential enhancement in D113212 (also 7e30404c ). There's an improvement for AArch that could be generalized ( X > -1 --> X >= 0 ). For x86, we have a counter-acting fold for most cases that turns the shift+not back into a setcc, so that needs a work-around to get more cases to use "pandn": D113603 Note that this pattern (and a previous one) are not currently canonical forms in IR: https://alive2.llvm.org/ce/z/e4o96b Adding swapped variants is left as a TODO item here, but is planned as a near-term follow-up patch. Differential Revision: https://reviews.llvm.org/D113426
Loading
Please register or sign in to comment