[PATCH] D118644: [x86] invert a vector select IR canonicalization with a binop identity constant
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 1 08:39:39 PST 2022
spatel marked an inline comment as done.
spatel added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:48984-48987
+ case ISD::FADD: // X + -0.0 --> X
+ return C->isZero() && C->isNegative();
+ case ISD::FSUB: // X - 0.0 --> X
+ return C->isZero() && !C->isNegative();
----------------
pengfei wrote:
> Do we need to consider the nsz case?
In IR, it looks like we still create the -0.0 constant even with nsz, but yes, I suspect we will want to handle both forms of zero if we have NSZ.
We'll need more test coverage. I'll add another TODO for now.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118644/new/
https://reviews.llvm.org/D118644
More information about the llvm-commits
mailing list