HomePhabricator

[X86][MC] Support enhanced relaxation for branch align
Audit Required916044d819c8

Authored by skan on Apr 6 2020, 9:27 PM.

Description

[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

Details

Auditors
grosbach
Committed
skanApr 8 2020, 4:08 AM
Reviewer
reames
Differential Revision
D76286: [X86][MC] Support enhanced relaxation for branch align
Parents
rG893df2032d48: [IfConversion] Disallow TrueBB == FalseBB for valid diamonds
Branches
Unknown
Tags
Unknown