-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[snippy][AsmParser] Add DoNotCompress flag for MachineInstr
In snippy we need a mechanism to pass information if an instruction can be compressed or not to AsmPrinter. This patch uses AsmPrinterFlags for this purpose. It will work is a following way. To generate instructions according to the given histogram, snippy will disallow compressing main instructions by adding DoNotCompress flag to them.
- Loading branch information
Showing
10 changed files
with
161 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
llvm/test/tools/llvm-snippy/do-not-compress-main-instrs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# COM: run snippy and print MF that contains opcodes as we generated them in snippy | ||
# RUN: llvm-snippy %s -o %t -dump-mf >& %t.dump.mf | ||
|
||
# COM: objdump resulting elf, compressed instructions will be parsed with "c.*" | ||
# RUN: llvm-objdump %t.elf -M no-aliases -d >& %t.dump.obj | ||
|
||
# COM: count entries of compressed add instructions from both dumps | ||
# RUN: grep "C_ADD" %t.dump.mf | wc -l >& %t.count.mf | ||
# RUN: grep "c.add" %t.dump.obj | wc -l >& %t.count.obj | ||
|
||
# COM: check that the number of compressed instructions in MF dump and resulting elf | ||
# COM: is the same. | ||
# RUN: diff -q %t.count.mf %t.count.obj | ||
|
||
options: | ||
march: riscv64-unknown-elf | ||
mattr: +c | ||
num-instrs: 100000 | ||
|
||
sections: | ||
- no: 1 | ||
VMA: 0 | ||
SIZE: 0x1000000 | ||
LMA: 0 | ||
ACCESS: rx | ||
- no: 2 | ||
VMA: 0x1000000 | ||
SIZE: 0x1000000 | ||
LMA: 0 | ||
ACCESS: rw | ||
|
||
histogram: | ||
- [ADD, 1.0] | ||
- [C_ADD, 1.0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.