llvm-project
5da2c09e - [X86][ISel] Fix VPTERNLOG matching ensuring the InnerOp is logicOp (#166591)

Commit
39 days ago
[X86][ISel] Fix VPTERNLOG matching ensuring the InnerOp is logicOp (#166591) This patch fixes a crash in `tryVPTERNLOG` when trying to peel out the outer not in cases like `~(A | B | C)`. Previously, `InnerOp` was taken directly from `Op->getOperand(0)` before verifying that it was a logical operation. As a result, the code could later access `InnerOp->getOperand(0)` or `InnerOp->getOperand(1)` even when `InnerOp` was something like a bitcast, causing an error. This patch applies `getFoldableLogicOp` to `InnerOp`, ensuring that `InnerOp` is a valid logic operation before it is dereferenced.
Author
Parents
Loading