This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU/SI: Emit constant arrays in the .text section
ClosedPublic

Authored by tstellarAMD on Dec 4 2015, 7:35 PM.

Details

Summary

This allows us to remove the END_OF_TEXT_LABEL hack we had been using
and simplifies the fixups used to compute the address of constant
arrays.

Diff Detail

Repository
rL LLVM

Event Timeline

tstellarAMD retitled this revision from to AMDGPU/SI: Emit constant arrays in the .text section.
tstellarAMD updated this object.
tstellarAMD added a reviewer: arsenm.
tstellarAMD added a subscriber: llvm-commits.
arsenm edited edge metadata.Dec 4 2015, 9:12 PM

Can you use a bundle instead of creating a pseudo with a special pass required to expand it? I've started working on using bundles for soft clauses so the passes necessary for those will be run anyway

tstellarAMD edited edge metadata.

Expand pseudo instruction post-RA using bundles to avoid using a custom
expander pass.

arsenm added a comment.Dec 8 2015, 2:56 PM

I think you need to run a pass to finalize bundles somewhere to add the register uses/defs on the BUNDLE instruction and set internal-read flags, but I haven't yet figured out how this works. Things seem to mostly work if you don't do this, and I'm not sure why this doesn't trigger any verifier errors.

arsenm added inline comments.Dec 8 2015, 3:01 PM
lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
339 ↗(On Diff #42194)

Oh, I missed this before. I think this might need to run earlier but I'm not sure

Can you use a bundle instead of creating a pseudo with a special pass required to expand it? I've started working on using bundles for soft clauses so the passes necessary for those will be run anyway

I was unable to get this work. I kept getting

lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
339 ↗(On Diff #42194)

I'm not really sure either. I was a little concerned that having it earlier might break the existing passes which may be using the wrong type of instruction iterator for handling bundles.

Manually finalize the bundle rather than running the FinalizeBundle pass.

arsenm accepted this revision.Dec 8 2015, 4:05 PM
arsenm edited edge metadata.

LGTM

lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
116 ↗(On Diff #42240)

s/to/too/ and s/requres/requires/

This revision is now accepted and ready to land.Dec 8 2015, 4:05 PM
This revision was automatically updated to reflect the committed changes.
llvm/trunk/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp