[llvm] [X86]: Reassoc demorgan rule for ANDN (PR #163789)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 16 23:49:12 PDT 2025
kper wrote:
At the moment, there is an infinity loop with `Andnp` for some tests.
```
/// Do target-specific dag combines on X86ISD::ANDNP nodes.
static SDValue combineAndnp(SDNode *N, SelectionDAG &DAG,
TargetLowering::DAGCombinerInfo &DCI,
const X86Subtarget &Subtarget) {
...
// Folds for better commutativity:
if (N1->hasOneUse()) {
// ANDNP(x,NOT(y)) -> AND(NOT(x),NOT(y)) -> NOT(OR(X,Y)).
if (SDValue Not = IsNOT(N1, DAG))
return DAG.getNOT(
DL, DAG.getNode(ISD::OR, DL, VT, N0, DAG.getBitcast(VT, Not)), VT);
// ...
```
Once the demorgan is applied and we have an `ANDNP`, it tries to revert it.
@RKSimon I suppose that I can remove this, right?
https://github.com/llvm/llvm-project/pull/163789
More information about the llvm-commits
mailing list