[PATCH] D104707: {X86] Fold nested select_cc to select (cmp*ge/le Cond0, Cond1), LHS, Y)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 22 06:00:21 PDT 2021


RKSimon created this revision.
RKSimon added reviewers: lebedev.ri, craig.topper, spatel.
Herald added subscribers: steven.zhang, pengfei, hiraditya.
RKSimon requested review of this revision.
Herald added a project: LLVM.

select (cmpeq Cond0, Cond1), LHS, (select (cmpugt Cond0, Cond1), LHS, Y) --> (select (cmpuge Cond0, Cond1), LHS, Y)

- etc --

We already perform this fold in DAGCombiner for MVT::i1 comparison results, but these can still appear after legalization (in x86 case to MVT::i8 results), where we need to be more careful about generating new comparison codes.

Pulled out of D101074 <https://reviews.llvm.org/D101074> to help address the remaining regressions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104707

Files:
  llvm/lib/Target/X86/X86ISelLowering.cpp
  llvm/test/CodeGen/X86/sdiv_fix_sat.ll
  llvm/test/CodeGen/X86/udiv_fix_sat.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104707.353618.patch
Type: text/x-patch
Size: 16698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210622/7086c706/attachment.bin>


More information about the llvm-commits mailing list