This is an archive of the discontinued LLVM Phabricator instance.

MC: Allow getMaxInstLength to depend on the subtarget
ClosedPublic

Authored by arsenm on May 20 2019, 4:10 AM.

Details

Reviewers
echristo
rampitec
Summary

Keep it optional in cases this is ever needed in some global
context. Currently it's only used for getting an upper bound inline
asm code size.

For AMDGPU, gfx10 increases the maximum instruction size to
12-bytes. This avoids penalizing older subtargets when estimating code
size, and making some annoying branch relaxation test adjustments.

Diff Detail

Event Timeline

arsenm created this revision.May 20 2019, 4:10 AM
rampitec added inline comments.May 20 2019, 11:05 AM
lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCAsmInfo.cpp
26

I believe it is 20 though:

  1. GFX10: image_sample_c_d v[16:19], [v8, v9, v10, v11, v12, v13, v14, v15, v16, v17], s[20:27], s[100:103] dmask:0xf dim:SQ_RSRC_IMG_3D ; encoding: [0x16,0x0f,0xa8,0xf0,0x08,0x10,0x25,0x03,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,0x10,0x11,0x00,0x00,0x00]
arsenm updated this revision to Diff 200367.May 20 2019, 3:24 PM

Increase to 20

This revision is now accepted and ready to land.May 20 2019, 5:21 PM
arsenm updated this revision to Diff 200711.May 22 2019, 5:41 AM

Avoid duplicating in the disassembler

arsenm updated this revision to Diff 200715.May 22 2019, 5:50 AM

Use NSA feature

JFYI, you need to mention nsa in the commit description.

arsenm closed this revision.May 22 2019, 9:30 AM

r361405