AMDGPU: Use conditions directly in division expansion
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 11 Feb 2020 20:13:42 +0000 (15:13 -0500)
committerMatt Arsenault <arsenm2@gmail.com>
Wed, 12 Feb 2020 04:11:30 +0000 (23:11 -0500)
commit6d4ebada797f22f1bdb9bf07f7e51671d6af458c
treea796df51ebb36ce784810a7407f273677909a4c6
parenta5153dbc368e1a484e179fafce7a260410d20569
AMDGPU: Use conditions directly in division expansion

This was creating a select on true/false values, and then comparing
that later. This produced more work for later combines, which can be
avoided by just using the boolean values. This was copied from the
original DAG expansion, which also has the same problem. This doesn't
have a observable change using SelectionDAG, but since GlobalISel is
missing these optimizations, the final code was noticeably longer.
llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-fold-binop-select.ll
llvm/test/CodeGen/AMDGPU/amdgpu-codegenprepare-idiv.ll