[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:36:31 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG76f040bda6d0: [BOLT] Provide generic implementations for isLoad/isStore (authored by jobnoorman).

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.555288.patch
Type: text/x-patch
Size: 1388 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230901/c74bfffd/attachment.bin>


More information about the llvm-commits mailing list