[llvm] [DAG] Refactor X86 combineVSelectWithAllOnesOrZeros fold into a generic DAG Combine (PR #145298)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 25 03:33:21 PDT 2025


woruyu wrote:

> > ```
> > 2. for andnot, just keep in x86 backend.
> > ```
> 
> why can't we wrap this in a TLI.hasAndNot check and create `DAG.getNode(ISD::AND, dl, VL, DAG.getNOT(X), Y)` ?

of course, but when i do this with `DAG.getNode(ISD::AND, dl, VL, DAG.getNOT(X), Y)` I don't get the desired results on the x86 backend. The reason is :

![image](https://github.com/user-attachments/assets/da180776-4864-412f-b31c-1b06e57dd30f)



https://github.com/llvm/llvm-project/pull/145298


More information about the llvm-commits mailing list