1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00
llvm-mirror/tools
Andrea Di Biagio db94372a40 [MCA] Simplify the rounding logic used in TimelineView::printWaitTimeEntry.
This is related to PR51392.

Before this patch, the timeline view was rounding doubles to the first decimal,
using a logic similar to this:

```
  double AverageTime = (double)Input / CumulativeExecutions;
  double Result = floor((AverageTime * 10) + 0.5) / 10
```

Here, Input and CumulativeExecutions are both unsigned integers.
The last operation is what effectively performs the rounding of AverageTime.

PR51392 has been raised because - under specific -m32 configurations of GCC -
one of the timeline tests reports slighlty different values (due to a different
rounding choice).

This patch tries to minimise the propagation of floating-point error by
hoisting the multiply by 10, so that it is performed on the unsigned.

```
  double AverageTime = (double)(Input * 10) / CumulativeExecutions;
  floor(AverageTime + 0.5) / 10
```

So we are trading a floating point multiply for a integer multiply (which can be
expanded using a simple MUL or using an `ADD + LEA` sequence). This decrease in
floating point operations executed should also help with decreasing the error in
the computation..

Strictly speaking, that computation will always be potentially subject to error
(depending on what values are passed in input). However, this patch should
improve the situation and make bug like PR51392 less frequent.

(cherry picked from commit 45685a1fc4524579a25b03eb1a27e8fcb792afc7)
2021-08-11 13:42:58 -07:00
..
bugpoint [NewPM] Consistently use 'simplifycfg' rather than 'simplify-cfg' 2021-07-09 09:47:03 +02:00
bugpoint-passes
dsymutil [OptTable] Rename PrintHelp to printHelp 2021-06-24 14:47:03 -07:00
gold [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold 2021-07-20 13:22:00 -07:00
llc [llc] Default MCUseDwarfDirectory to true 2021-07-12 17:44:02 -07:00
lli [ORC] Require ExecutorProcessControl when constructing an ExecutionSession. 2021-07-27 16:53:49 +10:00
llvm-ar [llvm] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
llvm-as [OpaquePtr] Introduce option to force all pointers to be opaque pointers 2021-06-24 13:32:31 -07:00
llvm-as-fuzzer Fix several places that were calling verifyFunction or verifyModule without checking the return value. 2020-05-18 13:28:46 -07:00
llvm-bcanalyzer Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
llvm-c-test [ADT] Move DenseMapInfo for ArrayRef/StringRef into respective headers (NFC) 2021-06-03 18:34:36 +02:00
llvm-cat [tools] Use llvm::append_range (NFC) 2021-01-05 21:15:56 -08:00
llvm-cfi-verify [llvm][tools] Hide unrelated llvm-cfi-verify options 2021-07-16 10:43:52 +02:00
llvm-config [MinGW] Use lib prefix for libraries 2020-09-12 22:01:29 +03:00
llvm-cov [llvm] Rename StringRef _lower() method calls to _insensitive() 2021-06-25 00:22:01 +03:00
llvm-cvtres [OptTable] Rename PrintHelp to printHelp 2021-06-24 14:47:03 -07:00
llvm-cxxdump [llvm][tools] Hide more unrelated tool options 2021-07-20 13:27:33 +02:00
llvm-cxxfilt [llvm-cxxfilt] Switch command line parsing from llvm::cl to OptTable 2021-07-09 10:10:45 -07:00
llvm-cxxmap [llvm][tools] Hide more unrelated tool options 2021-07-20 13:27:33 +02:00
llvm-diff [llvm-diff] Check for recursive initialiers 2021-07-21 14:21:21 -07:00
llvm-dis [llvm][tools] Hide more unrelated tool options 2021-07-20 13:27:33 +02:00
llvm-dwarfdump Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
llvm-dwp [DWP] Refactoring llvm-dwp in to a library part 2 2021-07-22 14:23:29 -07:00
llvm-exegesis Merge all the llvm-exegesis unit tests into a single binary 2021-07-26 22:07:07 -07:00
llvm-extract llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
llvm-go
llvm-gsymutil Add --quiet option to llvm-gsymutil to suppress output of warnings. 2021-05-27 12:36:34 +00:00
llvm-ifs [llvm][tools] Hide more unrelated tool options 2021-07-20 13:27:33 +02:00
llvm-isel-fuzzer [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
llvm-itanium-demangle-fuzzer
llvm-jitlink [ORC] Require ExecutorProcessControl when constructing an ExecutionSession. 2021-07-27 16:53:49 +10:00
llvm-jitlistener [MCJIT] Profile the code generated by MCJIT engine using Intel VTune profiler 2020-11-16 19:28:14 +11:00
llvm-libtool-darwin Use ManagedStatic and lazy initialization of cl::opt in libSupport to make it free of global initializer 2021-07-16 07:38:16 +00:00
llvm-link [llvm][tools] Hide more unrelated LLVM tool options 2021-07-21 09:14:04 +02:00
llvm-lipo [OptTable] Rename PrintHelp to printHelp 2021-06-24 14:47:03 -07:00
llvm-lto [llvm][tools] Hide more unrelated LLVM tool options 2021-07-21 09:14:04 +02:00
llvm-lto2 [LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold 2021-07-20 13:22:00 -07:00
llvm-mc [llvm][tools] Hide more unrelated LLVM tool options 2021-07-21 09:14:04 +02:00
llvm-mc-assemble-fuzzer [llvm-mc-assemble-fuzzer] Initialize MCTargetOptions. 2021-07-22 14:36:37 +08:00
llvm-mc-disassemble-fuzzer Add missing include Host.h in llvm-mc-* fuzzers. NFC. 2020-05-18 02:21:22 +07:00
llvm-mca [MCA] Simplify the rounding logic used in TimelineView::printWaitTimeEntry. 2021-08-11 13:42:58 -07:00
llvm-microsoft-demangle-fuzzer Give microsoftDemangle() an outparam for how many input bytes were consumed. 2020-05-20 16:17:31 -04:00
llvm-ml [ms] [llvm-ml] Support built-in text macros 2021-07-21 11:44:09 -04:00
llvm-modextract [llvm][tools] Hide more unrelated LLVM tool options 2021-07-21 09:14:04 +02:00
llvm-mt [OptTable] Rename PrintHelp to printHelp 2021-06-24 14:47:03 -07:00
llvm-nm [llvm-nm] Remove one-dash long options except -arch 2021-07-15 09:50:37 -07:00
llvm-objcopy [llvm-objcopy] Fix section group flag read/write when operating on a cross-endian object file 2021-07-26 15:09:15 -07:00
llvm-objdump [llvm-objdump][WebAssembly] Fix llvm-objdump on files without symbols 2021-07-19 08:59:26 +02:00
llvm-opt-fuzzer [NewPM] Hide pass manager debug logging behind -debug-pass-manager-verbose 2021-05-07 21:51:47 -07:00
llvm-opt-report [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
llvm-pdbutil [llvm][tools] Hide more unrelated LLVM tool options 2021-07-21 09:14:04 +02:00
llvm-profdata [profile] Add binary id into profiles 2021-07-23 00:19:12 +00:00
llvm-profgen [llvm][tools] Hide more unrelated LLVM tool options 2021-07-21 09:14:04 +02:00
llvm-rc [llvm-rc] Allow specifying language with a leading 0x prefix 2021-08-06 12:39:15 -07:00
llvm-readobj [llvm-readobj] Display multiple function names for stack size entries 2021-07-26 14:49:53 +01:00
llvm-reduce [llvm][tools] Hide remaining unrelated llvm- tool options 2021-07-22 09:47:55 +02:00
llvm-rtdyld [llvm][tools] Hide remaining unrelated llvm- tool options 2021-07-22 09:47:55 +02:00
llvm-rust-demangle-fuzzer Fix implicit dependency on <string> header. NFCI. 2021-06-11 10:24:14 +01:00
llvm-shlib [CMake] Don't use -Bsymbolic-functions for MinGW targets 2021-06-30 22:54:26 +03:00
llvm-sim [IRSim] Adding basic implementation of llvm-sim. 2021-06-23 14:38:58 -05:00
llvm-size [llvm-size] Switch command line parsing from llvm::cl to OptTable 2021-07-09 10:26:53 -07:00
llvm-special-case-list-fuzzer
llvm-split [llvm][tools] Hide remaining unrelated llvm- tool options 2021-07-22 09:47:55 +02:00
llvm-stress [llvm][tools] Hide remaining unrelated llvm- tool options 2021-07-22 09:47:55 +02:00
llvm-strings [llvm-strings] Switch command line parsing from llvm::cl to OptTable 2021-07-05 10:46:17 -07:00
llvm-symbolizer [llvm-symbolizer] Remove one-dash long options 2021-07-23 08:35:45 -07:00
llvm-tapi-diff [llvm-tapi-diff] Wrap empty string around StringLiteral NFC 2021-06-23 11:41:03 -07:00
llvm-undname [llvm][tools] Hide remaining unrelated llvm- tool options 2021-07-22 09:47:55 +02:00
llvm-xray xray-color-helper.cpp - add missing implicit cmath header dependency. NFCI. 2021-06-05 21:33:24 +01:00
llvm-yaml-numeric-parser-fuzzer [llvm] NFC: Cleanup llvm-yaml-numeric-parser-fuzzer 2021-02-15 14:52:53 +01:00
llvm-yaml-parser-fuzzer [llvm] Use llvm::erase_value and llvm::erase_if (NFC) 2021-01-02 09:24:15 -08:00
lto [AIX] Build libLTO as MODULE rather than SHARED 2021-06-10 12:08:59 -04:00
msbuild
obj2yaml [yaml2obj][MachO] Rename PayloadString to Content 2021-07-26 09:04:51 -07:00
opt [NewPM][opt] Add -debug-pass-manager=quiet to not print analysis info 2021-07-19 15:08:26 -07:00
opt-viewer Convert old python3 cgi method into the new html one 2020-03-25 22:38:55 +01:00
remarks-shlib [tools][remarks-shlib] Don't build libRemarks.so without PIC 2020-09-20 12:40:21 +02:00
sancov [MC] Refactor MCObjectFileInfo initialization and allow targets to create MCObjectFileInfo 2021-05-23 14:15:23 -07:00
sanstats [NFC] Reordering parameters in getFile and getFileOrSTDIN 2021-03-25 09:47:49 -04:00
split-file NFC: .clang-tidy: Inherit configs from parents to improve maintainability 2021-06-08 08:25:59 -07:00
verify-uselistorder [SystemZ][z/OS][Windows] Add new OF_TextWithCRLF flag and use this flag instead of OF_Text 2021-04-06 07:23:31 -04:00
vfabi-demangle-fuzzer
xcode-toolchain
yaml2obj [llvm] Make obj2yaml and yaml2obj LLVM utilities instead of tools 2020-10-19 10:21:21 -07:00
CMakeLists.txt [Flang] add flang as a new subproject in cmake 2020-04-09 16:13:18 +01:00