[PATCH] D142284: [DAG] Enable reassociate for SMAX/SMIN/UMAX/UMIN nodes

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 07:41:57 PST 2023


RKSimon created this revision.
RKSimon added reviewers: craig.topper, asb, spatel, belickim.
Herald added subscribers: luke, StephenFan, frasercrmck, ecnelises, luismarques, apazos, sameer.abuasal, pengfei, s.egerton, Jim, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, niosHD, sabuasal, simoncook, johnrusso, rbar, hiraditya.
Herald added a project: All.
RKSimon requested review of this revision.
Herald added subscribers: pcwang-thead, MaskRay.
Herald added a project: LLVM.

This helps us fold a number of cases where we're clamping chains of values with constant min/max values.

There is an instruction increase in the vtrunc_v128i32_v128i64 test as what had been chains of umin(umin(umin(x,c1),c2),c3), created by multiple levels of SplitEVL legalization calls, are flattened, resulting in better instruction parallelism but also an increase in in-flight values. This is a common issue with node reassociation, so I'm not sure if this is of any particular concern?

Fixes #58110


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142284

Files:
  llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  llvm/test/CodeGen/RISCV/rvv/fixed-vector-trunc-vp.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-strided-vpload.ll
  llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vpload.ll
  llvm/test/CodeGen/X86/combine-smax.ll
  llvm/test/CodeGen/X86/combine-smin.ll
  llvm/test/CodeGen/X86/combine-umax.ll
  llvm/test/CodeGen/X86/combine-umin.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142284.491076.patch
Type: text/x-patch
Size: 26828 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230121/70dcb3ad/attachment.bin>


More information about the llvm-commits mailing list