summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [ThinLTO] Handle -fdebug-pass-manager for backend invocations via clangTeresa Johnson2017-11-101-0/+1
| | | | | | | | | | | | | | Summary: The LTO Config field wasn't being set when invoking a ThinLTO backend via clang (i.e. for distributed builds). Reviewers: danielcdh Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D39923 llvm-svn: 317951
* [SanitizerCoverage] Add stack depth tracing instrumentation.Matt Morehouse2017-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: Augment SanitizerCoverage to insert maximum stack depth tracing for use by libFuzzer. The new instrumentation is enabled by the flag -fsanitize-coverage=stack-depth and is compatible with the existing trace-pc-guard coverage. The user must also declare the following global variable in their code: thread_local uintptr_t __sancov_lowest_stack https://bugs.llvm.org/show_bug.cgi?id=33857 Reviewers: vitalybuka, kcc Reviewed By: vitalybuka Subscribers: kubamracek, hiraditya, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D36839 llvm-svn: 311186
* Update for llvm change.Rafael Espindola2017-08-031-10/+12
| | | | llvm-svn: 309912
* [sanitizer-coverage] clang flags pumbing for -fsanitize-coverage=pc-tableKostya Serebryany2017-07-281-0/+1
| | | | llvm-svn: 309338
* Make new PM honor -fdebug-info-for-profiling (clang side)Dehao Chen2017-07-271-22/+21
| | | | | | | | | | | | | | Summary: The new PM needs to invoke add-discriminator pass when building with -fdebug-info-for-profiling. Reviewers: chandlerc, davidxl Reviewed By: chandlerc Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D35746 llvm-svn: 309282
* [PM] Setup TargetLibraryInfo correctly for the new pass manager.Chandler Carruth2017-07-251-0/+8
| | | | | | | Without this, -fno-builtin and friends doesn't work. Added the obvious RUN lines to the test for -fno-builtin and they pass now. llvm-svn: 308967
* Use DenseMap instead std::map for GVSummaryMapTyDehao Chen2017-07-101-1/+1
| | | | | | | | | | | | | | Summary: Frontend change for https://reviews.llvm.org/D35148 Reviewers: tejohnson Reviewed By: tejohnson Subscribers: sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D35153 llvm-svn: 307584
* Changed Opts.EABIVersion type string to llvm::EABI enum classYuka Takahashi2017-07-011-5/+1
| | | | | | | | | | Summary: Changed EABIVersion type from string to llvm::EABI. It seems it was just a typo and this is intended implementation. Differential Revision: https://reviews.llvm.org/D34595 llvm-svn: 306953
* Remove Clang support for '-fvectorize-slp-aggressive' which used LLVM'sChandler Carruth2017-06-301-1/+0
| | | | | | | | | | | | | | | | | | basic block vectorizer. This vectorizer has had no known users for many, many years and is completely surpassed by the normal '-fvectorize-slp'-controlled SLP vectorizer in LLVM. Hal proposed this back in 2014 to no objections: http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html While this patch completely removes the flag, Joerg is working on a patch that will add it back in a way that warns users and ignores the flag in a clear and well factored way (so that we can keep doing this going forward). Differential Revision: https://reviews.llvm.org/D34846 llvm-svn: 306786
* [PM] Add support for sample PGO in the new pass manager (clang-side)Dehao Chen2017-06-291-1/+5
| | | | | | | | | | | | | | Summary: This implements the clang bits of https://reviews.llvm.org/D34720, and add corresponding test to verify if it worked. Reviewers: chandlerc, davidxl, davide, tejohnson Reviewed By: chandlerc, tejohnson Subscribers: tejohnson, sanjoy, mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D34721 llvm-svn: 306764
* [NewPM] Add Clang cc1 flag -fdebug-pass-manager for printing debug information.Tim Shen2017-06-291-4/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D34790 llvm-svn: 306757
* [ThinkLTO] Invoke build(Thin)?LTOPreLinkDefaultPipeline.Tim Shen2017-06-291-4/+16
| | | | | | | | | | | | | Previously it doesn't actually invoke the designated new PM builder functions. This patch moves NameAnonGlobalPass out from PassBuilder, as Chandler points out that PassBuilder is used for non-O0 builds, and for optimizations only. Differential Revision: https://reviews.llvm.org/D34728 llvm-svn: 306756
* Apply summary-based dead stripping to regular LTO modules with summaries.Peter Collingbourne2017-06-151-4/+4
| | | | | | | | | | | | | | | If a regular LTO module has a summary index, then instead of linking it into the combined regular LTO module right away, add it to the combined summary index and associate it with a special module that represents the combined regular LTO module. Any such modules are linked during LTO::run(), at which time we use the results of summary-based dead stripping to control whether to link prevailing symbols. Differential Revision: https://reviews.llvm.org/D33922 llvm-svn: 305482
* Represent debug information compression type fullySaleem Abdulrasool2017-06-091-1/+1
| | | | | | | | | | | This is tied with the LLVM side of the change to expose the debug information compression types to clang. We now track the compression type as an enumeration rather than a boolean. We still use the same value (GNU) that we did previously. This is in preparation to support passing down the compression type and switch it based on the command line. llvm-svn: 305039
* [sanitizer-coverage] one more flavor of coverage: ↵Kostya Serebryany2017-06-081-0/+1
| | | | | | -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. Reapplying revisions 304630, 304631, 304632, 304673, see PR33308 llvm-svn: 305026
* Revert "[sanitizer-coverage] one more flavor of coverage: ↵Renato Golin2017-06-051-1/+0
| | | | | | | | -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. (clang part)" This reverts commit r304631, as it broke ARM/AArch64 bots for 2 days. llvm-svn: 304697
* [sanitizer-coverage] one more flavor of coverage: ↵Kostya Serebryany2017-06-031-0/+1
| | | | | | -fsanitize-coverage=inline-8bit-counters. Experimental so far, not documenting yet. (clang part) llvm-svn: 304631
* [ThinLTO] Wire up ThinLTO and new PMTim Shen2017-06-011-3/+21
| | | | | | | | | | | | Summary: This patch teaches clang to use and propagate new PM in ThinLTO. Reviewers: davide, chandlerc, tejohnson Subscribers: mehdi_amini, Prazek, inglorion, cfe-commits Differential Revision: https://reviews.llvm.org/D33692 llvm-svn: 304496
* Remove ignore-empty-index-file optionTeresa Johnson2017-05-121-1/+2
| | | | | | | | | | | | | | | | Summary: Clang changes to remove this option and replace with a parameter always set in the context of a ThinLTO distributed backend. Depends on D33133. Reviewers: pcc Subscribers: mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D33134 llvm-svn: 302940
* [asan] A clang flag to enable ELF globals-gc.Evgeniy Stepanov2017-05-091-0/+2
| | | | | | | | | | | | This feature is subtly broken when the linker is gold 2.26 or earlier. See the following bug for details: https://sourceware.org/bugzilla/show_bug.cgi?id=19002 Since the decision needs to be made at compilation time, we can not test the linker version. The flag is off by default on ELF targets, and on otherwise. llvm-svn: 302591
* [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a ↵Kostya Serebryany2017-05-051-0/+1
| | | | | | hidden -mllvm flag. clang part. llvm-svn: 302320
* Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in ↵Peter Collingbourne2017-05-041-2/+6
| | | | | | | | the module summary. NFCI." with a fix for the clang backend. llvm-svn: 302176
* Revert "IR: Use pointers instead of GUIDs to represent edges in the module ↵Eric Liu2017-05-041-2/+2
| | | | | | | | summary. NFCI." This reverts commit r302108. llvm-svn: 302141
* IR: Use pointers instead of GUIDs to represent edges in the module summary. ↵Peter Collingbourne2017-05-041-2/+2
| | | | | | | | | | | | | | | | | | | | NFCI. When profiling a no-op incremental link of Chromium I found that the functions computeImportForFunction and computeDeadSymbols were consuming roughly 10% of the profile. The goal of this change is to improve the performance of those functions by changing the map lookups that they were previously doing into pointer dereferences. This is achieved by changing the ValueInfo data structure to be a pointer to an element of the global value map owned by ModuleSummaryIndex, and changing reference lists in the GlobalValueSummary to hold ValueInfos instead of GUIDs. This means that a ValueInfo will take a client directly to the summary list for a given GUID. Differential Revision: https://reviews.llvm.org/D32471 llvm-svn: 302108
* Object: Remove ModuleSummaryIndexObjectFile class.Peter Collingbourne2017-05-011-1/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D32195 llvm-svn: 301832
* [asan] Unconditionally enable GC of globals on COFF.Evgeniy Stepanov2017-04-261-2/+1
| | | | | | | | | | | This change restores pre-r301225 behavior, where linker GC compatible global instrumentation was used on COFF targets disregarding -f(no-)data-sections and/or /Gw flags. This instrumentation puts each global in a COMDAT with an ASan descriptor for that global. It effectively enables -fdata-sections, but limits it to ASan-instrumented globals. llvm-svn: 301374
* [asan] Disable ASan global-GC depending on the target and compiler flags.Evgeniy Stepanov2017-04-241-6/+30
| | | | llvm-svn: 301225
* Move Split DWARF handling to an MC option/command line argument rather than ↵David Blaikie2017-04-211-0/+2
| | | | | | | | | | | | | | | | | | | using metadata Since Split DWARF needs to name the actual .dwo file that is generated, it can't be known at the time the llvm::Module is produced as it may be merged with other Modules before the object is generated and that object may be generated with any name. By passing the Split DWARF file name when LLVM is producing object code the .dwo file name in the object file can match correctly. The support for Split DWARF for implicit modules remains the same - using metadata to store the dwo name and dwo id so that potentially multiple skeleton CUs referring to different dwo files can be generated from one llvm::Module. llvm-svn: 301063
* Don't pass FPOpFusion::Strict to the backendAdam Nemet2017-04-201-1/+3
| | | | | | | | | | | | | | | This restores the behavior prior to D31167 where the code-gen default was FPC_On which mapped to FPOpFusion::Standard. After merging the FE state (on/off) and the code-gen state (on/fast/off), the default became off to match the front-end. In other words, the front-end controls when to fuse along the language standards and the backend shouldn't override this by splitting fused intrinsics as FPOpFusion::Strict would imply. Differential Revision: https://reviews.llvm.org/D32301 llvm-svn: 300858
* Parse backend options during thinlto backend compile actionsDavid Blaikie2017-04-191-6/+5
| | | | llvm-svn: 300741
* [Driver] Don't crash on invalid values of -mrelocation-model=.Davide Italiano2017-04-011-1/+2
| | | | | | | This is handled in a similar way we handle invalid -mcode-model. PR: 31840 llvm-svn: 299315
* [ThinLTO] Handle -emit-llvm* in ThinLTO backendsTeresa Johnson2017-03-311-1/+22
| | | | | | | | | | | | | | Summary: Use PreCodeGenModuleHook to invoke the correct writer when emitting LLVM IR, returning false to skip codegen from within thinBackend. Reviewers: pcc, mehdi_amini Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D31534 llvm-svn: 299274
* [ThinLTO] Set up lto::Config properly for codegen in ThinLTO backendsTeresa Johnson2017-03-311-125/+153
| | | | | | | | | | | | | | | | Summary: This involved refactoring out pieces of EmitAssemblyHelper::CreateTargetMachine for use in runThinLTOBackend. Subsumes D31114. Reviewers: mehdi_amini, pcc Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D31508 llvm-svn: 299152
* Use FPContractModeKind universallyAdam Nemet2017-03-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FPContractModeKind is the codegen option flag which is already ternary (off, on, fast). This makes it universally the type for the contractable info across the front-end: * In FPOptions (i.e. in the Sema + in the expression nodes). * In LangOpts::DefaultFPContractMode which is the option that initializes FPOptions in the Sema. Another way to look at this change is that before fp-contractable on/off were the only states handled to the front-end: * For "on", FMA folding was performed by the front-end * For "fast", we simply forwarded the flag to TargetOptions to handle it in LLVM Now off/on/fast are all exposed because for fast we will generate fast-math-flags during CodeGen. This is toward moving fp-contraction=fast from an LLVM TargetOption to a FastMathFlag in order to fix PR25721. --- This is a recommit of r299027 with an adjustment to the test CodeGenCUDA/fp-contract.cu. The test assumed that even though -ffp-contract=on is passed FE-based folding of FMA won't happen. This is obviously wrong since the user is asking for this explicitly with the option. CUDA is different that -ffp-contract=fast is on by default. The test used to "work" because contract=fast and contract=on were maintained separately and we didn't fold in the FE because contract=fast was on due to the target-default. This patch consolidates the contract=on/fast/off state into a ternary state hence the change in behavior. --- Differential Revision: https://reviews.llvm.org/D31167 llvm-svn: 299033
* Revert "Use FPContractModeKind universally"Adam Nemet2017-03-291-4/+4
| | | | | | | | This reverts commit r299027. It's causing a test failure in clang's CodeGenCUDE/fp-contract.cu llvm-svn: 299029
* Use FPContractModeKind universallyAdam Nemet2017-03-291-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | FPContractModeKind is the codegen option flag which is already ternary (off, on, fast). This makes it universally the type for the contractable info across the front-end: * In FPOptions (i.e. in the Sema + in the expression nodes). * In LangOpts::DefaultFPContractMode which is the option that initializes FPOptions in the Sema. Another way to look at this change is that before fp-contractable on/off were the only states handled to the front-end: * For "on", FMA folding was performed by the front-end * For "fast", we simply forwarded the flag to TargetOptions to handle it in LLVM Now off/on/fast are all exposed because for fast we will generate fast-math-flags during CodeGen. This is toward moving fp-contraction=fast from an LLVM TargetOption to a FastMathFlag in order to fix PR25721. Differential Revision: https://reviews.llvm.org/D31167 llvm-svn: 299027
* [ThinLTO] Clang support for emitting minimized bitcode for thin linkTeresa Johnson2017-03-231-2/+17
| | | | | | | | | | | | | | | | | Summary: Clang companion patch to LLVM patch D31027, which adds support for emitting minimized bitcode file for use in the thin link step. Add a cc1 option -fthin-link-bitcode=<file> to trigger this behavior. Depends on D31027. Reviewers: mehdi_amini, pcc Subscribers: cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31050 llvm-svn: 298639
* Apply clang-tidy's performance-unnecessary-value-param to parts of clang.Benjamin Kramer2017-03-211-1/+1
| | | | | | No functionality change intended. llvm-svn: 298443
* Clang change: Do not inline hot callsites for samplepgo in thinlto compile ↵Dehao Chen2017-03-211-1/+6
| | | | | | | | | | | | | | | | | | phase. Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro file, thus we do not want to inline hot callsites in the first phase. Reviewers: tejohnson, eraman Reviewed By: tejohnson Subscribers: mehdi_amini, cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31202 llvm-svn: 298429
* Remove setting LessPreciseFPMADOption on the TargetOption as it'sEric Christopher2017-03-171-1/+0
| | | | | | unused anywhere in llvm. llvm-svn: 298022
* Only enable AddDiscriminator pass when -fdebug-info-for-profiling is trueDehao Chen2017-02-211-2/+4
| | | | | | | | | | | | | | Summary: AddDiscriminator pass is only useful for sample pgo. This patch restricts AddDiscriminator to -fdebug-info-for-profiling so that it does not introduce unecessary debug size increases for non-sample-pgo builds. Reviewers: dblaikie, aprantl Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30220 llvm-svn: 295764
* [PM] Add support for instrumented PGO in the new pass manager (clang-side)Davide Italiano2017-02-131-2/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D29309 llvm-svn: 294961
* [CodeGen] Remove unneeded `private`. NFCI.Davide Italiano2017-02-091-1/+0
| | | | llvm-svn: 294623
* Change debug-info-for-profiling from a TargetOption to a function attribute.Dehao Chen2017-02-011-1/+0
| | | | | | | | | | | | | | Summary: cfe change for https://reviews.llvm.org/D29203 Reviewers: echristo, dblaikie Reviewed By: dblaikie Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D29205 llvm-svn: 293834
* Re-apply r292662, "IRGen: Start using the WriteThinLTOBitcode pass."Peter Collingbourne2017-01-261-3/+5
| | | | | | The internal build issue has been resolved. llvm-svn: 293231
* Use TargetMachine adjustPassManager hookStanislav Mekhanoshin2017-01-261-6/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D28340 llvm-svn: 293190
* IRGen: Factor out function clang::FindThinLTOModule. NFCI.Peter Collingbourne2017-01-241-21/+21
| | | | llvm-svn: 292970
* Add LF_ prefix to LibFunc enums in TargetLibraryInfo.David L. Jones2017-01-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The LibFunc::Func enum holds enumerators named for libc functions. Unfortunately, there are real situations, including libc implementations, where function names are actually macros (musl uses "#define fopen64 fopen", for example; any other transitively visible macro would have similar effects). Strictly speaking, a conforming C++ Standard Library should provide any such macros as functions instead (via <cstdio>). However, there are some "library" functions which are not part of the standard, and thus not subject to this rule (fopen64, for example). So, in order to be both portable and consistent, the enum should not use the bare function names. The old enum naming used a namespace LibFunc and an enum Func, with bare enumerators. This patch changes LibFunc to be an enum with enumerators prefixed with "LF_". (Unfortunately, a scoped enum is not sufficient to override macros.) These changes are for clang. See https://reviews.llvm.org/D28476 for LLVM. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28477 llvm-svn: 292849
* Revert "IRGen: Start using the WriteThinLTOBitcode pass."Martin Bohme2017-01-231-5/+3
| | | | | | | | | | | | | Summary: This reverts commit r292662. This change broke internal builds. Will provide a reproducer internally. Subscribers: pcc, mehdi_amini, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D29025 llvm-svn: 292791
* IRGen: Start using the WriteThinLTOBitcode pass.Peter Collingbourne2017-01-201-3/+5
| | | | | | | | This is the final change necessary to support CFI with ThinLTO. Differential Revision: https://reviews.llvm.org/D28843 llvm-svn: 292662
OpenPOWER on IntegriCloud