[all-commits] [llvm/llvm-project] 916044: [X86][MC] Support enhanced relaxation for branch a...

KanRobert via All-commits all-commits at lists.llvm.org
Wed Apr 8 04:08:38 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 916044d819c8e383fe1cd99190e3ff572d80f48f
      https://github.com/llvm/llvm-project/commit/916044d819c8e383fe1cd99190e3ff572d80f48f
  Author: Shengchen Kan <shengchen.kan at intel.com>
  Date:   2020-04-08 (Wed, 08 Apr 2020)

  Changed paths:
    M llvm/include/llvm/MC/MCAsmBackend.h
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp
    A llvm/test/MC/X86/align-branch-enhanced-relaxation.s

  Log Message:
  -----------
  [X86][MC] Support enhanced relaxation for branch align

Summary:
Since D75300 has been landed, I want to support enhanced relaxation when we need to align branches and allow prefix padding. "Enhanced Relaxtion" means we allow an instruction that could not be traditionally relaxed to be emitted into RelaxableFragment so that we increase its length by adding prefixes for optimization.

The motivation is straightforward, RelaxFragment is mostly for relative jumps and we can not increase the length of jumps when we need to align them, so if we need to achieve D75300's purpose (reducing the bytes of nops) when need to align jumps, we have to make more instructions "relaxable".

Reviewers: reames, MaskRay, craig.topper, LuoYuanke, jyknight

Reviewed By: reames

Subscribers: hiraditya, llvm-commits, annita.zhang

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76286




More information about the All-commits mailing list