[PATCH] D76398: [X86] Limit prefix padding w/target specific padding amount
Kan Shengchen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 27 01:34:13 PDT 2020
skan added inline comments.
================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:865
+ const unsigned TargetPrefixMax =
+ std::min(maximumPrefixPadding(STI), (unsigned)X86PadMaxPrefixSize);
+
----------------
Use a C++ style cast here.
================
Comment at: llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp:865
+ const unsigned TargetPrefixMax =
+ std::min(maximumPrefixPadding(STI), (unsigned)X86PadMaxPrefixSize);
+
----------------
skan wrote:
> Use a C++ style cast here.
Since the bug fix patch D76285 was landed, I think we can allow all targets to decide how many prefixes can be added by default,
and user can pass option -x86-pad-max-prefix-size to override the default value.
================
Comment at: llvm/test/MC/X86/prefix-padding-length.s:11
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -x86-pad-max-prefix-size=15 -mcpu=skx | llvm-objdump -d --section=.text - | FileCheck %s --check-prefix=CHECK64-PREFIX15
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -x86-pad-max-prefix-size=15 -mcpu=atom | llvm-objdump -d --section=.text - | FileCheck %s --check-prefix=CHECK64-PREFIX2
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux-gnu %s -x86-pad-max-prefix-size=15 -mcpu=silvermont | llvm-objdump -d --section=.text - | FileCheck %s --check-prefix=CHECK64-PREFIX0
----------------
>From my knowledge, atom can decode 5 prefixes without penalty.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76398/new/
https://reviews.llvm.org/D76398
More information about the llvm-commits
mailing list