[AMDGPU] Early expansion of 32 bit udiv/urem
authorStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 28 Jun 2018 15:59:18 +0000 (15:59 +0000)
committerStanislav Mekhanoshin <Stanislav.Mekhanoshin@amd.com>
Thu, 28 Jun 2018 15:59:18 +0000 (15:59 +0000)
commit67aa18f165640374cf0e0a6226dc793bbda6e74f
tree5f9b9048fb5281c25640e57e37ec352c201c7887
parent877f9a7e392f0bbc61225f498fd9cf6462f1dd28
[AMDGPU] Early expansion of 32 bit udiv/urem

This allows hoisting of a common code, for instance if denominator
is loop invariant. Current change is expansion only, adding licm to
the target pass list going to be a separate patch. Given this patch
changes to codegen are minor as the expansion is similar to that on
DAG. DAG expansion still must remain for R600.

Differential Revision: https://reviews.llvm.org/D48586

llvm-svn: 335868
llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-i16-to-i32.ll
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-idiv.ll [new file with mode: 0644]
llvm/test/CodeGen/AMDGPU/dagcombine-select.ll