Reid Kleckner via llvm-dev
2016-Jun-29 16:27 UTC
[llvm-dev] x86: How to Force 2-byte `jmp` instruction in lowering
On Wed, Jun 22, 2016 at 9:36 AM, Nirav Davé <llvm-dev at lists.llvm.org> wrote:> In any case, the issue appears to be that llvm doesn't realize that the > target address is resolved and erroneously applies branch relaxation to the > jump. I don't know why a linker private symbol would make a difference. >Relaxation is the process of *shortening* jumps that can be shortened, and then re-running instruction layout to discover more relaxations until fixpoint. Removing the -relax-all flag in clang won't help here, it would hurt. I'm not exactly sure what the semantics of linker private symbols are, but using a normal assembler temporary label is probably the way to go anyway. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160629/87386802/attachment.html>
Craig Topper via llvm-dev
2016-Jun-29 17:05 UTC
[llvm-dev] x86: How to Force 2-byte `jmp` instruction in lowering
I thought jumps start short and relaxation widens them as needed until fixpoint. So relax-all causes them all to be widened unconditionally. On Wed, Jun 29, 2016 at 9:27 AM, Reid Kleckner via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On Wed, Jun 22, 2016 at 9:36 AM, Nirav Davé <llvm-dev at lists.llvm.org> > wrote: > >> In any case, the issue appears to be that llvm doesn't realize that the >> target address is resolved and erroneously applies branch relaxation to the >> jump. I don't know why a linker private symbol would make a difference. >> > > Relaxation is the process of *shortening* jumps that can be shortened, and > then re-running instruction layout to discover more relaxations until > fixpoint. Removing the -relax-all flag in clang won't help here, it would > hurt. > > I'm not exactly sure what the semantics of linker private symbols are, but > using a normal assembler temporary label is probably the way to go anyway. > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-- ~Craig -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160629/f6a315ea/attachment.html>
Reid Kleckner via llvm-dev
2016-Jun-29 17:19 UTC
[llvm-dev] x86: How to Force 2-byte `jmp` instruction in lowering
On Wed, Jun 29, 2016 at 10:05 AM, Craig Topper <craig.topper at gmail.com> wrote:> I thought jumps start short and relaxation widens them as needed until > fixpoint. So relax-all causes them all to be widened unconditionally. >My mistake, you're right. I've been reading that code for years and assuming that it goes large-to-small, but I guess the process is the same regardless of which direction you go. :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160629/a01b486e/attachment.html>