[DAG] SimplifyDemandedBits - use KnownBits comparisons to remove ISD::UMIN/UMAX ops
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 18 Jan 2021 10:29:08 +0000 (10:29 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 18 Jan 2021 10:29:23 +0000 (10:29 +0000)
commit207f32948b2408bebd5a523695f6f7c08049db74
treec0dba75beb471a80e5f66a2acbf6d80bd9f84e10
parentac603c8d3850ed0c715c421d79bb5cb014bb21de
[DAG] SimplifyDemandedBits - use KnownBits comparisons to remove ISD::UMIN/UMAX ops

Use the KnownBits icmp comparisons to determine when a ISD::UMIN/UMAX op is unnecessary should either op be known to be ULT/ULE or UGT/UGE than the other.

Differential Revision: https://reviews.llvm.org/D94532
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/test/CodeGen/AMDGPU/r600-legalize-umax-bug.ll
llvm/test/CodeGen/X86/combine-umin.ll
llvm/test/CodeGen/X86/sdiv_fix_sat.ll
llvm/test/CodeGen/X86/udiv_fix_sat.ll