This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/GlobalISel: Implement select for G_ICMP and G_SELECT
ClosedPublic

Authored by tstellar on Apr 12 2019, 3:35 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellar created this revision.Apr 12 2019, 3:35 PM
arsenm added inline comments.Apr 17 2019, 4:54 AM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
69–74 ↗(On Diff #194975)

This should not happen? There should be no 1-bit SReg_32_XM0RegClassID registers

86–87 ↗(On Diff #194975)

This isn't true, or at least isn't supposed to be. The SCC bank needs to be distinct from a 1-bit value in an SGPR bank

tstellar marked an inline comment as done.May 24 2019, 7:23 PM
tstellar added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
86–87 ↗(On Diff #194975)

When we select scc uses/defs, we need to copy the value from/to an 32-bit sgpr to handle the case where there are 2 scc values live at the same time.

arsenm added inline comments.May 24 2019, 7:30 PM
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
86–87 ↗(On Diff #194975)

Do you have an example of this? I think this shouldn't be possible. We don't use SCC in the cases where > 1 use are needed in a single instruction (i.e. and/or/xor)

tstellar marked an inline comment as done.May 24 2019, 7:33 PM
tstellar added inline comments.
llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
86–87 ↗(On Diff #194975)

What I'm talking about is scenarios like the icmp_s_mix testcase in this patch.

arsenm accepted this revision.May 24 2019, 7:58 PM

lgtm

llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
468 ↗(On Diff #194975)

const &

496 ↗(On Diff #194975)

s/compares/select?

This revision is now accepted and ready to land.May 24 2019, 7:58 PM

Are you going to commit this?

This revision was automatically updated to reflect the committed changes.