[DAGCombiner] Add special case fast paths for udiv x,1 and udiv x,-1
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 10 Jul 2018 16:33:07 +0000 (16:33 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 10 Jul 2018 16:33:07 +0000 (16:33 +0000)
commit4cb460939288ce50119fb5101e0b8629b14db8e0
tree0021d758fe9cae82d324de35be48036c91f3c533
parent2b9b85f2bf4e104cf135adc96e1c5533a1456e80
[DAGCombiner] Add special case fast paths for udiv x,1 and udiv x,-1

udiv x,-1 was going down the (slow) BuildUDIV route resulting in unnecessary shifts.

llvm-svn: 336701
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/test/CodeGen/X86/combine-udiv.ll