forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BOLT] Provide generic implementations for isLoad/isStore
`MCInstrDesc` provides the `mayLoad` and `mayStore` flags that seem appropriate to use as a target-independent way to implement `isLoad` and `isStore`. I believe this is currently good enough to use for the RISC-V target as well. I've provided a test for this that checks the generated dyno stats (which seems to be the only thing both `isLoad` and `isStore` are used for). Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D159266
- Loading branch information
Showing
2 changed files
with
18 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// RUN: %clang %cflags -o %t %s | ||
// RUN: link_fdata --no-lbr %s %t %t.fdata | ||
// RUN: llvm-bolt %t -o /dev/null --data=%t.fdata --dyno-stats | FileCheck %s | ||
|
||
// CHECK: BOLT-INFO: program-wide dynostats after all optimizations before SCTC and FOP (no change): | ||
// CHECK: 3000 : executed instructions | ||
// CHECK: 1000 : executed load instructions | ||
// CHECK: 1000 : executed store instructions | ||
|
||
.globl _start | ||
_start: | ||
# FDATA: 1 _start #_start# 1 | ||
ld t0, (gp) | ||
sd t0, (gp) | ||
ret | ||
.size _start, .-_start |