[PATCH] D159266: [BOLT] Provide generic implementations for isLoad/isStore
Job Noorman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 1 00:06:41 PDT 2023
jobnoorman updated this revision to Diff 555281.
jobnoorman added a comment.
Use double dashes for llvm-bolt arguments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159266/new/
https://reviews.llvm.org/D159266
Files:
bolt/include/bolt/Core/MCPlusBuilder.h
bolt/test/RISCV/load-store.s
Index: bolt/test/RISCV/load-store.s
===================================================================
--- /dev/null
+++ bolt/test/RISCV/load-store.s
@@ -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
Index: bolt/include/bolt/Core/MCPlusBuilder.h
===================================================================
--- bolt/include/bolt/Core/MCPlusBuilder.h
+++ bolt/include/bolt/Core/MCPlusBuilder.h
@@ -614,13 +614,11 @@
virtual bool isMoveMem2Reg(const MCInst &Inst) const { return false; }
virtual bool isLoad(const MCInst &Inst) const {
- llvm_unreachable("not implemented");
- return false;
+ return Info->get(Inst.getOpcode()).mayLoad();
}
virtual bool isStore(const MCInst &Inst) const {
- llvm_unreachable("not implemented");
- return false;
+ return Info->get(Inst.getOpcode()).mayStore();
}
virtual bool isCleanRegXOR(const MCInst &Inst) const {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159266.555281.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230901/f2c36916/attachment.bin>
More information about the llvm-commits
mailing list