OSDN Git Service

AMDGPU: Fix handling of div_scale with undef inputs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Aug 2017 20:49:41 +0000 (20:49 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 1 Aug 2017 20:49:41 +0000 (20:49 +0000)
commitf9a65f9c7e982fb2a6ce7211fe38f105c8e2868c
tree177212e92355d1bda2b9fa614836931e86f07a03
parent68a49615caebf025742fece0c67c35bc83fd8007
AMDGPU: Fix handling of div_scale with undef inputs

The src0 register must match src1 or src2, but if these
were undefined they could end up using different implicit_defed
virtual registers. Force these to use one undef vreg or pick the
defined other register.

Also fixes producing invalid nodes without the right number of
inputs when src2 is undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309743 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/AMDGPU/SIISelLowering.cpp
test/CodeGen/AMDGPU/llvm.amdgcn.div.scale.ll