This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Use constant and externally_initialized for block handle
ClosedPublic

Authored by arsenm on Jan 9 2023, 1:36 PM.

Details

Reviewers
rampitec
yaxunl
Group Reviewers
Restricted Project
Summary

Also stop using a null initializer. The runtime initializes this, but
I don't see why we aren't using relocations for this. We should be
able to easily fill in the function address. The private/group size
should also be available by relocations but aren't.

Diff Detail

Event Timeline

arsenm created this revision.Jan 9 2023, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 1:36 PM
arsenm requested review of this revision.Jan 9 2023, 1:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2023, 1:36 PM
Herald added a subscriber: wdng. · View Herald Transcript
yaxunl added a comment.Jan 9 2023, 2:11 PM

I doubt this will work. First, this may result in missing symbol in lld. Second, the runtime currently expects *.runtime_handle global symbols having a certain size and will initialize them by copying to them. If this compiler change requires a corresponding runtime change, it should be coordinated with runtime.

arsenm added a comment.Jan 9 2023, 2:12 PM

I doubt this will work. First, this may result in missing symbol in lld. Second, the runtime currently expects *.runtime_handle global symbols having a certain size and will initialize them by copying to them. If this compiler change requires a corresponding runtime change, it should be coordinated with runtime.

It does work, this just changes optimizer behavior

arsenm added a comment.Jan 9 2023, 2:14 PM

I doubt this will work. First, this may result in missing symbol in lld. Second, the runtime currently expects *.runtime_handle global symbols having a certain size and will initialize them by copying to them. If this compiler change requires a corresponding runtime change, it should be coordinated with runtime.

It does work, this just changes optimizer behavior

Neither the size, name nor linkage changes

yaxunl accepted this revision as: yaxunl.Jan 9 2023, 2:20 PM

I doubt this will work. First, this may result in missing symbol in lld. Second, the runtime currently expects *.runtime_handle global symbols having a certain size and will initialize them by copying to them. If this compiler change requires a corresponding runtime change, it should be coordinated with runtime.

It does work, this just changes optimizer behavior

Neither the size, name nor linkage changes

Then it should be OK.

This revision is now accepted and ready to land.Jan 9 2023, 2:20 PM
arsenm added a comment.Jan 9 2023, 2:24 PM

I posted the g version of this, still needs the undef initializer. available_externally and constant initializer are the useful parts, and can use undef initializer. the zeroinitializer was pointless since it's overwritten

arsenm updated this revision to Diff 487564.Jan 9 2023, 2:47 PM

Drop initializer change, needs to be undef, zero or the actual content and there's no practical difference

yaxunl accepted this revision.Jan 9 2023, 2:55 PM