Skip to content

Commit 19c4fc5

Browse files
committedDec 28, 2016
This is a large patch for X86 AVX-512 of an optimization for reducing code size by encoding EVEX AVX-512 instructions using the shorter VEX encoding when possible.
There are cases of AVX-512 instructions that have two possible encodings. This is the case with instructions that use vector registers with low indexes of 0 - 15 and do not use the zmm registers or the mask k registers. The EVEX encoding prefix requires 4 bytes whereas the VEX prefix can take only up to 3 bytes. Consequently, using the VEX encoding for these instructions results in a code size reduction of ~2 bytes even though it is compiled with the AVX-512 features enabled. Reviewers: Craig Topper, Zvi Rackoover, Elena Demikhovsky Differential Revision: https://reviews.llvm.org/D27901 llvm-svn: 290663
1 parent b956570 commit 19c4fc5

File tree

71 files changed

+8200
-2329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+8200
-2329
lines changed
 

‎llvm/include/llvm/CodeGen/MachineInstr.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class MachineInstr
6060
/// otherwise easily derivable from the IR text.
6161
///
6262
enum CommentFlag {
63-
ReloadReuse = 0x1
63+
ReloadReuse = 0x1 // higher bits are reserved for target dep comments.
6464
};
6565

6666
enum MIFlag {
@@ -143,8 +143,8 @@ class MachineInstr
143143
}
144144

145145
/// Set a flag for the AsmPrinter.
146-
void setAsmPrinterFlag(CommentFlag Flag) {
147-
AsmPrinterFlags |= (uint8_t)Flag;
146+
void setAsmPrinterFlag(uint8_t Flag) {
147+
AsmPrinterFlags |= Flag;
148148
}
149149

150150
/// Clear specific AsmPrinter flags.

‎llvm/include/llvm/MC/MCStreamer.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ class MCStreamer {
262262
///
263263
/// If the comment includes embedded \n's, they will each get the comment
264264
/// prefix as appropriate. The added comment should not end with a \n.
265-
virtual void AddComment(const Twine &T) {}
265+
/// By default, each comment is terminated with an end of line, i.e. the
266+
/// EOL param is set to true by default. If one prefers not to end the
267+
/// comment with a new line then the EOL param should be passed
268+
/// with a false value.
269+
virtual void AddComment(const Twine &T, bool EOL = true) {}
266270

267271
/// \brief Return a raw_ostream that comments can be written to. Unlike
268272
/// AddComment, you are required to terminate comments with \n if you use this

0 commit comments

Comments
 (0)
Please sign in to comment.