OSDN Git Service

[SystemZ] Improve handling and cost estimates of vector integer div/rem
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Thu, 25 Oct 2018 21:47:22 +0000 (21:47 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Thu, 25 Oct 2018 21:47:22 +0000 (21:47 +0000)
commitff3c72bc7c5cb096cc570f3b7d21f9b50501d239
tree23865783424c2f26aa22d8c3072b36c9d3a05ba2
parent441900b083e3f315dac3a05b4cfa52b7e41c3d12
[SystemZ]  Improve handling and cost estimates of vector integer div/rem

Enable the DAG optimization that converts vector div/rem with constants into
multiply+shifts sequences by expanding them early. This is needed since
ISD::SMUL_LOHI is 'Custom' lowered on SystemZ, and will therefore not be
available to BuildSDIV after legalization.

Better cost values for these instructions based on how they will be
implemented (a constant divisor is cheaper).

Review: Ulrich Weigand
https://reviews.llvm.org/D53196

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345321 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/SystemZ/SystemZISelLowering.cpp
lib/Target/SystemZ/SystemZISelLowering.h
lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
test/Analysis/CostModel/SystemZ/div-pow2.ll [deleted file]
test/Analysis/CostModel/SystemZ/divrem-const.ll [new file with mode: 0644]
test/Analysis/CostModel/SystemZ/divrem-pow2.ll [new file with mode: 0644]
test/Analysis/CostModel/SystemZ/divrem-reg.ll [new file with mode: 0644]
test/Analysis/CostModel/SystemZ/int-arith.ll
test/Analysis/CostModel/SystemZ/memop-folding-int-arith.ll