AMDGPU: Fix overriding global FP atomic feature predicates
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 4 Jun 2020 18:37:39 +0000 (14:37 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 4 Jun 2020 21:50:38 +0000 (17:50 -0400)
commit1657f0ebc2b4d3ec5b9e717119238e9198ad203c
treecaf8834c6573f92a5666f86e940a1ffa0f0864cd
parent651c36b5086db9038591bd1ac387dcb492d011f8
AMDGPU: Fix overriding global FP atomic feature predicates

Global TableGen let override blocks are pretty dangerous and override
any local special cases. In this case, the broader HasFlatGlobalInsts
was overriding the more specific predicate for
FeatureAtomicFaddInsts. Make sure HasFlatGlobalInsts is implied by
FeatureAtomicFaddInsts, and make sure the right predicate is used.

One issue with independently setting the subtarget features on
incompatible targets is all of the encoding families do not define all
opcodes. This will hit an assert on gfx10 for example, since we set
the encoding independently based on the generation and not based on a
feature.
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/FLATInstructions.td
llvm/test/CodeGen/AMDGPU/global-atomics-fp.ll
llvm/test/CodeGen/AMDGPU/llvm.amdgcn.atomic.fadd.ll