This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix s_branch with -1 offset
ClosedPublic

Authored by SamWot on Sep 16 2016, 8:32 AM.

Details

Summary

In case s_branch instruction target is itself backend should emit offset -1 but instead it emit 0.

label:
    s_branch label  // should emit [0xff,0xff,0x82,0xbf]

Tom, Matt: why are we adjusting fixup values in applyFixup() method instead of processFixup()? processFixup() is calling adjustFixupValue() but does nothing with its result.

Diff Detail

Repository
rL LLVM

Event Timeline

SamWot updated this revision to Diff 71654.Sep 16 2016, 8:32 AM
SamWot retitled this revision from to [AMDGPU] Fix s_branch with -1 offset.
SamWot updated this object.
SamWot added reviewers: vpykhtin, artem.tamazov.
SamWot updated this object.Sep 16 2016, 8:33 AM
SamWot edited edge metadata.
SamWot added a subscriber: Restricted Project.

I changed this in r279895 to match what AArch64 does and report an error based on the context rather than just report_fatal_error

lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
143 ↗(On Diff #71654)

I think this can be sunk down to the use

SamWot updated this revision to Diff 71662.Sep 16 2016, 9:15 AM

Moved adjustFixupFalue() usage to processFixup() method

arsenm accepted this revision.Sep 16 2016, 10:15 AM
arsenm added a reviewer: arsenm.

LGTM

This revision is now accepted and ready to land.Sep 16 2016, 10:15 AM
This revision was automatically updated to reflect the committed changes.