[llvm] [DAGCombiner] Turn `(neg (max x, (neg x)))` into `(min x, (neg x))` (PR #120666)

Min-Yih Hsu via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 26 15:53:05 PST 2024


mshockwave wrote:

Note that I just made this rule be applicable to pre-legalized phases as well. My argument is that since I already checked the legality of the newly generated operation, it shouldn't matter whether it's ran before or after the legalization. Plus, this will make it to support RISC-V's fixed vectors out of the box (scalable vectors are not covered though, because although SDPatternMatch can use the same pattern on both scalar and VP operations through MatchContext, it needs to change visitSUB's signature to accept a MatchContext argument). 

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


More information about the llvm-commits mailing list