[PATCH] D128960: [BOLT] Fix instrumentation problem with floating point

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 1 15:29:55 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3a47037fcc3c: [BOLT] Fix instrumentation problem with floating point (authored by maksfb).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128960/new/

https://reviews.llvm.org/D128960

Files:
  bolt/runtime/CMakeLists.txt
  bolt/test/runtime/X86/instrumentation-xmm.c


Index: bolt/test/runtime/X86/instrumentation-xmm.c
===================================================================
--- /dev/null
+++ bolt/test/runtime/X86/instrumentation-xmm.c
@@ -0,0 +1,25 @@
+#include <stdio.h>
+
+void foo(float a) {
+  printf("a = %f\n", a);
+}
+
+typedef void (*fptr_t)(float);
+fptr_t func = foo;
+
+int main() {
+  func(42);
+  return 0;
+}
+
+/*
+## Check that BOLT instrumentation runtime preserves xmm registers.
+
+REQUIRES: system-linux,bolt-runtime
+
+RUN: %clang %cflags %s -o %t.exe -fno-inline -Wl,-q
+RUN: llvm-bolt %t.exe --instrument -o %t.instrumented
+RUN: %t.instrumented | FileCheck %s
+
+CHECK: a = 42.000000
+*/
Index: bolt/runtime/CMakeLists.txt
===================================================================
--- bolt/runtime/CMakeLists.txt
+++ bolt/runtime/CMakeLists.txt
@@ -23,7 +23,8 @@
   -ffreestanding
   -fno-exceptions
   -fno-rtti
-  -fno-stack-protector)
+  -fno-stack-protector
+  -mno-sse)
 
 # Don't let the compiler think it can create calls to standard libs
 target_compile_options(bolt_rt_instr PRIVATE ${BOLT_RT_FLAGS} -fPIE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D128960.441801.patch
Type: text/x-patch
Size: 1096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220701/77bbb283/attachment.bin>


More information about the llvm-commits mailing list