Commit graph

34 commits

Author SHA1 Message Date
Johan Engelen
21c2c6dd4b [PGO] Update ldc-profdata-3.9 and profile-rt-39 to svn r273081 2016-06-20 17:39:46 +02:00
Johan Engelen
ea7a2e0d0f [PGO] Update ldc-profdata-3.9 and profile-rt-39 to svn r270319 2016-06-20 17:28:33 +02:00
Johan Engelen
103c6f557e [PGO] Update llvm-profdata-3.9 and profile-rt-39 to LLVM r269788. 2016-06-20 17:28:31 +02:00
Johan Engelen
3e0338088c Update llvm-profdata-3.9 2016-06-20 17:28:28 +02:00
Johan Engelen
e0d9c58443 [PGO] Add PGO to LDC. Supported for LLVM >= 3.7
Add the commandline options -fprofile-instr-generate[=filename] and -profile-instr-use=filename
-fprofile-instr-generate
-- Add instrumentation on branches, switches, and function entry; uses LLVM's InstrProf pass.
-- Link to profile runtime that writes instrumentation counters to a file.
-fprofile-instr-use
-- Read profile data from a file and apply branch weights to branches and switches, and annotate functions with entrycount in LLVM IR.
-- Functions with low or high entrycount are marked with 'cold' or 'inlinehint'.

The only statement type without PGO yet is "try-finally".

A new pragma, `pragma(LDC_profile_instr, [ true | false ])`, is added to selectively disable/enable instrumentation of functions (granularity = whole functions).

The runtime library ldc-profile-rt is a copy of LLVM compiler-rt lib/profile. It has to be exactly in-sync with the LLVM version, and thus we need a copy for each PGO-supported LLVM (>=3.7).
import ldc.profile for a D interface to ldc-profile-rt (for example to reset execution counts after a program startup phase).

The instrumentation data is mainly passed on to LLVM: function-entry counts and branch counts/probabilities. LDC marks functions as hot when "execution count is 30% of the maximum function execution count", and marks functions as cold if their count is 1% of maximum function execution count.

The source of LLVM's llvm-profdata tool is hereby included in LDCs repository (different source for each LLVM version), and the binary is included in the install bin folder.
The executable is named "ldc-profdata" to avoid clashing with llvm-profdata on the same machine. This is needed because profdata executable has to be in-sync with the LLVM version used to build LDC.

Maintenance burden: for trunk LLVM, we have to keep ldc-profile-rt and llvm-profdata in sync. There is no diff with upstream; but because of active development there are the occasional API changes.
2016-06-20 17:28:22 +02:00
Rainer Schuetze
c0027c1a29 update FileCheck-3.9.cpp from LLVM 2016-06-18 11:44:47 +02:00
Johan Engelen
7e8ffa8dbe "Update" FileCheck 3.5 and 3.6 to version 3.7.
Attempts to fix lit-based test errors possibly due to a FileCheck bug.
2016-06-12 11:46:14 +02:00
Kai Nacke
cb0f2e7e6a Fix space handling for different paths.
E.g. on my machine LLVM is installed in folder C:\My Program Files\LLVM.

Fixes part of issue #1465. (PR 1466 is required for complete fix.)
2016-05-16 00:12:27 +02:00
Johan Engelen
cd769a4736 Backport important features of recent FileCheck to the 3.5-3.8 versions.
(CHECK-SAME and erroring on unsupported "-NOT" check combinations)
2016-04-19 23:24:42 +02:00
Johan Engelen
8933212a7c Add FileCheck for LLVM 3.9. 2016-04-03 13:42:17 +02:00
Rainer Schuetze
0d08bb1d7a "Properties" has been renamed "IntrProperties" in LLVM 3.9 2016-02-21 10:33:35 +01:00
Johan Engelen
e731132d55 Testing: Add the utility not from LLVM. It is used for testing non-zero return values from a program, e.g. compile failures. 2016-02-15 22:44:38 +01:00
Johan Engelen
8e2f993117 Add LLVM trunk's version of FileCheck to the utils directory to fix Travis IR testing for LLVM 3.8 2015-12-18 16:48:32 +01:00
Johan Engelen
619bad1a4e Add IR test suite (using LLVM tools: lit and FileCheck) 2015-11-09 01:57:44 +01:00
Martin
2d959ea540 Make use of C++11 range-based for
Should be available now that support for LLVM < 3.5 has been dropped.
2015-11-01 14:49:04 +01:00
Martin
60d676e2a1 Drop support for LLVM < 3.5
This allows to clean up the code a little.
2015-10-30 22:24:05 +01:00
Marco Leise
ca8019dcc6 Make GCC intrinsics usable with @nogc and const *
Modifies gen_gccbuiltins.cpp to add the relatively new @nogc to each compiler intrinsic. Also adds 'const' to void* arguments of intrinsics with "IntrRead*Mem" set.
2015-09-18 00:55:11 +02:00
Kai Nacke
67dd76faf7 LLVM 3.7: ListInit.getSize() was renamed to ListInit.size().
This is in TableGen only and affects the gen_gccbuiltins utility.
2015-06-04 14:04:50 +02:00
kai
901f98572a Fix gen_gccbuiltins utility for LLVM 3.6
The used type is private but using auto helps here.
2014-09-13 19:44:01 +02:00
kai
b58f4e7173 First try at fixing gen_gccbuiltins for LLVM 3.6.
The referenced type is private therefore a LLVM change is required, too.
2014-09-05 16:31:15 +02:00
Jernej Krempuš
77c0192c06 Added a check for vector size to gen_gccbuiltins.cpp.
Previously, gen_gccbuiltins was emitting intrinsics
that used vector types larger than 256 bits and those
are not defined in core.simd.
2014-01-06 01:30:34 +01:00
kai
bb37ef656b Replace llvm::sys::Path with llvm::SmallString in gen_gccbuiltins.cpp. 2013-06-29 15:25:34 +02:00
David Nadlinger
0a96aea868 Sort includes according to style guidelines:
1. Main include corresponding to .cpp file, if any.
 2. DMD and LDC includes.
 3. LLVM includes.
 4. System includes.

Also updated a few include guards to match the default format.
2013-02-07 21:20:55 +01:00
David Nadlinger
5616753768 Consistently use quotes for LLVM includes. 2013-02-07 21:20:54 +01:00
kai
272e7b7a55 Follow "The Great Renaming" in LLVM 3.3
This time VMCore was renamed to IR. Several top level include
files were moved to new subfolder IR.
2013-01-03 08:52:23 +01:00
David Nadlinger
59a4a02e49 Cleanup: Avoid signed/unsigned comparisons.
The ones ones left are for DMD-defined constants.
2012-12-20 01:21:09 +01:00
David Nadlinger
9458911839 Added LLVM-style license headers to all our files. 2012-12-16 17:19:14 +01:00
jerro
bd98f8b106 Use LDC_intrinsic in gen_gccbuiltins
Pragma intrinsic is deprecated, so the gccbuiltins_x86.di must use LDC_intrinsic instead.
2012-12-09 05:20:55 +01:00
Jernej Krempuš
021f067963 Added pure, safe and nothrow to gccbuiltins. 2012-10-25 02:17:06 +02:00
kai
add8e91653 Locate Intrinsics.td in CMakeLists.txt.
The LLVM_INCLUDE_DIR is not always defined (e.g. missing in Windows). We simply locate the file and pass the folder path to the tool.
2012-10-18 07:12:13 +02:00
kai
0ebceb4e16 Make gen_gccbuiltins compilable with LLVM 3.2. 2012-10-14 21:42:17 +02:00
David Nadlinger
95121115d3 gen_gccbuiltins cleanup. 2012-10-14 05:09:15 +02:00
David Nadlinger
b0878bf8ef Fixed gccbuiltins module declaration. 2012-10-14 05:05:48 +02:00
Jernej Krempuš
f6cd185701 Generate gccbuiltins.di at build time.
Bug fixes.

Moved gen_gccbuiltins.cpp to util and renamed gccbuiltins.di to gccbuiltins_x86.di

Trying to fix Travis build.

Removed cstrVec.
2012-10-13 13:01:03 +02:00