AMDGPU/GlobalISel: Tolerate negated control flow intrinsic outputs
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 25 Aug 2020 23:53:32 +0000 (19:53 -0400)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Wed, 26 Aug 2020 12:58:54 +0000 (08:58 -0400)
commit21ccedc24fc49b43e84095b4773f8aa86c366dac
tree60f39e65d46a4d9963f691d5ef07820d2d7eab8d
parenteb074088c983ce6f255e0e83babdd32a4f2dd457
AMDGPU/GlobalISel: Tolerate negated control flow intrinsic outputs

If the condition output is negated, swap the branch targets. This is
similar to what SelectionDAG does for when SelectionDAGBuilder
decides to invert the condition and swap the branches.

This is leaving behind a dead constant def for some reason.
llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-amdgcn.if-invalid.mir
llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-brcond.mir