]> granicus.if.org Git - llvm/commit
DAG: Don't try to cluster loads with tied inputs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 8 Mar 2019 20:46:15 +0000 (20:46 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 8 Mar 2019 20:46:15 +0000 (20:46 +0000)
commited120704215ed838a59314a8e7dfe244656a261c
treec8995b0a9fd728863babd31f0f97fcd2651800a3
parentc00fa49767a5b3d361949cefdaf4dbfb527d1e8c
DAG: Don't try to cluster loads with tied inputs

This avoids breaking possible value dependencies when sorting loads by
offset.

AMDGPU has some load instructions that write into the high or low bits
of the destination register, and have a tied input for the other input
bits. These can easily have the same base pointer, but be a swizzle so
the high address load needs to come first. This was inserting glue
forcing the opposite ordering, producing a cycle the InstrEmitter
would assert on. It may be potentially expensive to look for the
dependency between the other loads, so just skip any where this could
happen.

Fixes bug 40936 by reverting r351379, which added a hacky attempt to
fix this by adding chains in this case, which I think was just working
around broken glue before the InstrEmitter. The core of the patch is
re-implementing the fix for that problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355728 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
lib/Target/AMDGPU/SIISelLowering.cpp
test/CodeGen/AMDGPU/chain-hi-to-lo.ll