This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Remove unreachable uncond branch after return
ClosedPublic

Authored by yota9 on Jan 19 2022, 6:50 AM.

Details

Summary

This patch fixes the removal of unreachable uncondtional branch located
after return instruction.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Diff Detail

Event Timeline

yota9 created this revision.Jan 19 2022, 6:50 AM
yota9 requested review of this revision.Jan 19 2022, 6:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 19 2022, 6:50 AM
Amir added inline comments.Jan 19 2022, 9:25 AM
bolt/test/X86/jmp-after-ret.s
19

Are you sure 1f here means the label and not a hex offset? Can you please use .L1 instead to make it explicit?

yota9 added inline comments.Jan 19 2022, 9:42 AM
bolt/test/X86/jmp-after-ret.s
19

This is default syntax for asm and called numeric label: https://docs.oracle.com/cd/E19120-01/open.solaris/817-5477/esqaq/index.html . I've checked the objdump for this (x86) and it works fine, and I'm sure about arm too :) I often see such syntax in linux kernel, so I think it is OK if you don't mind :)

Amir added inline comments.Jan 19 2022, 10:49 AM
bolt/test/X86/jmp-after-ret.s
19

Thanks for clarification. I wasn’t familiar with this syntax and it looks confusing, but as long as it works let’s keep it.

Amir accepted this revision.Jan 19 2022, 10:50 AM

LGTM

This revision is now accepted and ready to land.Jan 19 2022, 10:50 AM
This revision was automatically updated to reflect the committed changes.
yota9 marked 2 inline comments as done.