summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/BackendUtil.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix for r280064 that added options for fp denormals and exceptions.Sjoerd Meijer2016-09-231-0/+7
| | | | | | These options were forgotten to be copied in setCommandLineOpts. llvm-svn: 282255
* Remove InstructionCombining and its related pass from sample pgo passes as ↵Dehao Chen2016-09-191-13/+0
| | | | | | | | | | | | | | we can handle "invoke" correctly. Summary: We previously relies on InstructionCombining pass to remove invoke instructions. Now that we can inline invoke instructions correctly, we do not need these passes any more. Reviewers: dnovillo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D24730 llvm-svn: 281910
* [sanitizer-coverage] add yet another flavour of coverage instrumentation: ↵Kostya Serebryany2016-09-141-0/+1
| | | | | | trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. Clang part llvm-svn: 281432
* [sanitizer-coverage] add two more modes of instrumentation: trace-div and ↵Kostya Serebryany2016-08-301-0/+2
| | | | | | trace-gep, mostly usaful for value-profile-based fuzzing; clang part llvm-svn: 280044
* [ThinLTO] Adapt backend invocation to llvm API changes.Mehdi Amini2016-08-171-4/+18
| | | | | | | | | | Reviewers: tejohnson Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D23579 llvm-svn: 278906
* [PM] Update Clang for LLVM's r278896 which re-organized a header.Chandler Carruth2016-08-171-2/+3
| | | | | | (sorry this didn't get landed closer in time...) llvm-svn: 278897
* CodeGen: Replace ThinLTO backend implementation with a client of LTO/Resolution.Teresa Johnson2016-08-121-33/+64
| | | | | | | | | | | | | | | | Summary: This changes clang to use the llvm::lto::thinBackend function instead of its own less comprehensive ThinLTO backend implementation. Patch by Peter Collingbourne Reviewers: tejohnson, mehdi_amini Subscribers: cfe-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D21545 llvm-svn: 278541
* [ARM] Command-line options for embedded position-independent codeOliver Stannard2016-08-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (with the corresponding ARM backend patch) adds support for some new relocation models: * Read-only position independence (ROPI): Code and read-only data is accessed PC-relative. The offsets between all code and RO data sections are known at static link time. * Read-write position independence (RWPI): Read-write data is accessed relative to a static base register. The offsets between all writeable data sections are known at static link time. These two modes are independent (they specify how different objects should be addressed), so they can be used individually or together. These modes are intended for bare-metal systems or systems with small real-time operating systems. They are designed to avoid the need for a dynamic linker, the only initialisation required is setting the static base register to an appropriate value for RWPI code. There is one C construct not currently supported by these modes: global variables initialised to the address of another global variable or function, where that address is not known at static-link time. There are a few possible ways to solve this: * Disallow this, and require the user to write their own initialisation function if they need variables like this. * Emit dynamic initialisers for these variables in the compiler, called from the .init_array section (as is currently done for C++ dynamic initialisers). We have a patch to do this, described in my original RFC email (http://lists.llvm.org/pipermail/llvm-dev/2015-December/093022.html), but the feedback from that RFC thread was that this is not something that belongs in clang. * Use a small dynamic loader to fix up these variables, by adding the difference between the load and execution address of the relevant section. This would require linker co-operation to generate a table of addresses that need fixing up. Differential Revision: https://reviews.llvm.org/D23196 llvm-svn: 278016
* Initial vectorization support for svml calls (short vector math library).Matt Masten2016-07-291-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D19544 llvm-svn: 277167
* Add flags to toggle preservation of assembly commentsNirav Dave2016-07-271-0/+1
| | | | | | | | | | | | Summary: Add -fpreserve-as-comments and -fno-preserve-as-comments. Reviewers: echristo, rnk Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D22883 llvm-svn: 276907
* [Profile] Use a flag to enable PGO rather than the profraw filenameXinliang David Li2016-07-231-0/+1
| | | | | | | | Patch by Jake VanAdrighem Differential Revision: http://reviews.llvm.org/D22608 llvm-svn: 276517
* [Profile] Enable profile merging with -fprofile-generat[=<dir>]Xinliang David Li2016-07-221-1/+1
| | | | | | | This patch enables raw profile merging for this option which is the new intended behavior. llvm-svn: 276484
* Frontend: Simplify ownership model for clang's output streams.Peter Collingbourne2016-07-151-87/+60
| | | | | | | | | | | | | | This changes the CompilerInstance::createOutputFile function to return a std::unique_ptr<llvm::raw_ostream>, rather than an llvm::raw_ostream implicitly owned by the CompilerInstance. This in most cases required that I move ownership of the output stream to the relevant ASTConsumer. The motivation for this change is to allow BackendConsumer to be a client of interfaces such as D20268 which take ownership of the output stream. Differential Revision: http://reviews.llvm.org/D21537 llvm-svn: 275507
* Delete dead code.Sean Silva2016-07-101-1/+0
| | | | | | We were just setting DisableUnitAtATime to its default value. llvm-svn: 275005
* Invoke simplifycfg and sroa before instcombine.Dehao Chen2016-06-231-3/+9
| | | | | | | | | | | | Summary: InstCombine needs to be performed after simplifycfg and sroa, otherwise it may make bad optimization decisions. Reviewers: davidxl, wmi, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D21568 llvm-svn: 273606
* Add support for /Ob1 and -finline-hint-functions flagsHans Wennborg2016-06-221-1/+2
| | | | | | | | | | | | | | | | Add support for /Ob1 (and equivalent -finline-hint-functions), which enable inlining only for functions marked inline, either explicitly (via inline keyword, for example), or implicitly (function definition in class body, for example). This works by enabling inlining pass, and adding noinline attribute to every function not marked inline. Patch by Rudy Pons <rudy.pons@ilod.org>! Differential Revision: http://reviews.llvm.org/D20647 llvm-svn: 273440
* Invoke PruneEH pass before Sample Profile pass.Dehao Chen2016-06-211-0/+1
| | | | | | | | | | | | Summary: We need to call PruneEH pass before AutoFDO pass so that some EH-related calls can get inlined in Sample Profile pass. Reviewers: davidxl, dnovillo Subscribers: junbuml, llvm-commits Differential Revision: http://reviews.llvm.org/D21197 llvm-svn: 273298
* [asan] Added -fsanitize-address-use-after-scope flagVitaly Buka2016-06-021-4/+7
| | | | | | | | | | | | | | | | Summary: Also emit lifetime markers for -fsanitize-address-use-after-scope. Asan uses life-time markers for use-after-scope check. PR27453 Reviewers: kcc, eugenis, aizatsky Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20759 llvm-svn: 271451
* Handle -Wa,--mrelax-relocations=[no|yes].Rafael Espindola2016-05-291-0/+1
| | | | llvm-svn: 271162
* Add instcombine pass if sampleprofile pass is enabled.Dehao Chen2016-05-271-2/+10
| | | | | | | | | | | | Summary: Sample profile pass need to have instcombine pass. A related change is http://reviews.llvm.org/D17742. But we should not explicitly add dependency between to non-analysis passes. So we add the dependency here. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D20502 llvm-svn: 271010
* [esan|wset] Add working set tool driver flagsDerek Bruening2016-05-251-0/+2
| | | | | | | | | | | | | | Summary: Adds a new -fsanitize=efficiency-working-set flag to enable esan's working set tool. Adds appropriate tests for the new flag. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D20484 llvm-svn: 270641
* CodeGen: indicate to the backend the exception modelSaleem Abdulrasool2016-05-241-0/+3
| | | | | | | Thread through -fsjlj-exceptions to the backend via the TargetOptions. This is in preparation for supporting SjLj exceptions on x86 (e.g. for MinGW). llvm-svn: 270528
* CodeGen: address -Wcast-qual warningSaleem Abdulrasool2016-05-201-1/+1
| | | | | | Add a const_cast rather than the C-style cast. NFC. llvm-svn: 270180
* Update for llvm change.Rafael Espindola2016-05-181-1/+1
| | | | llvm-svn: 269989
* Change embed-bitcode linkage typeSteven Wu2016-05-161-22/+51
| | | | | | | | | | | Embedded bitcode should have private linkage instead of appending or external. Otherwise, it will cause link failure due to duplicated symbols. Also add llvm.embedded.module and llvm.cmdline to llvm.compiler.used so they don't get optimized out. rdar://problem/21555860 llvm-svn: 269679
* Fixed msvc warningsSimon Pilgrim2016-05-111-0/+2
| | | | llvm-svn: 269242
* Embed bitcode in object file (clang cc1 part)Steven Wu2016-05-111-0/+90
| | | | | | | | | | | | | | | | | | | Summary: Teach clang to embed bitcode inside bitcode. When -fembed-bitcode cc1 option is used, clang will embed both the input bitcode and cc1 commandline into the bitcode in special sections before compiling to the object file. Using -fembed-bitcode-marker will only introduce a marker in both sections. Depends on D17390 Reviewers: rsmith Subscribers: yaron.keren, vsk, cfe-commits Differential Revision: http://reviews.llvm.org/D17392 llvm-svn: 269202
* Delete store to Target option PositionIndependentExecutable as PIE is now ↵Sriraman Tallam2016-04-291-1/+0
| | | | | | | | set in module flags. Differential Revision: http://reviews.llvm.org/D19749 llvm-svn: 268137
* Call TargetMachine::addEarlyAsPossiblePasses from BackendUtil.Justin Lebar2016-04-271-0/+8
| | | | | | | | | | | | | | | Summary: As of D18614, TargetMachine exposes a hook to add a set of passes that should be run as early as possible. Invoke this hook from clang when setting up the pass manager. Reviewers: chandlerc Subscribers: rnk, cfe-commits, tra Differential Revision: http://reviews.llvm.org/D18617 llvm-svn: 267764
* [esan] EfficiencySanitizer driver flagsDerek Bruening2016-04-211-0/+18
| | | | | | | | | | | | | | | | Summary: Adds a framework to enable the instrumentation pass for the new EfficiencySanitizer ("esan") family of tools. Adds a flag for esan's cache fragmentation tool via -fsanitize=efficiency-cache-frag. Adds appropriate tests for the new flag. Reviewers: eugenis, vitalybuka, aizatsky, filcab Subscribers: filcab, kubabrecka, llvm-commits, zhaoqin, kcc Differential Revision: http://reviews.llvm.org/D19169 llvm-svn: 267059
* Update InstrProf pass creator API referenceXinliang David Li2016-04-181-1/+1
| | | | llvm-svn: 266638
* Pass -backend-option to LLVM when there is no target machine.Yaxun Liu2016-04-121-16/+23
| | | | | | | | Clang should pass -backend-option to LLVM even though there is no target machine, since LLVM passes are used when emitting LLVM IR. Differential Revision: http://reviews.llvm.org/D17552 llvm-svn: 266117
* Emit the module hash by default with -flto=thin.Mehdi Amini2016-04-111-1/+2
| | | | | | | | | | | Reviewers: tejohnson Subscribers: joker.eph, cfe-commits Differential Revision: http://reviews.llvm.org/D18947 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 265977
* Move EABIVersion from CodeGenOptions to TargetOptionsSaleem Abdulrasool2016-04-081-1/+1
| | | | | | | | | It is possible to argue that the EABIVersion field is similar in spirit to the ABI field in TargetOptions. It represents the embedded ABI that the target follows. This will allow us to thread this information into the target information construction. llvm-svn: 265807
* revert SVN r265702, r265640Saleem Abdulrasool2016-04-081-2/+2
| | | | | | | | | | | Revert the two changes to thread CodeGenOptions into the TargetInfo allocation and to fix the layering violation by moving CodeGenOptions into Basic. Code Generation is arguably not particularly "basic". This addresses Richard's post-commit review comments. This change purely does the mechanical revert and will be followed up with an alternate approach to thread the desired information into TargetInfo. llvm-svn: 265806
* Basic: move CodeGenOptions from FrontendSaleem Abdulrasool2016-04-071-2/+2
| | | | | | | | This is a mechanical move of CodeGenOptions from libFrontend to libBasic. This fixes the layering violation introduced earlier by threading CodeGenOptions into TargetInfo. It should also fix the modules based self-hosting builds. NFC. llvm-svn: 265702
* [ThinLTO] Clang side of renaming of function index (NFC)Teresa Johnson2016-03-151-18/+18
| | | | | | | | | This is the companion to an LLVM patch that renamed the function index data structures and files to use the more general module summary index. (Recommit after fixing LLVM side to add back missed file) llvm-svn: 263514
* Revert "[ThinLTO] Clang side of renaming of function index (NFC)"Teresa Johnson2016-03-141-18/+18
| | | | | | This reverts commit r263491. Missed a file on the LLVM side. llvm-svn: 263494
* [ThinLTO] Clang side of renaming of function index (NFC)Teresa Johnson2016-03-141-18/+18
| | | | | | | This is the companion to an LLVM patch that renamed the function index data structures and files to use the more general module summary index. llvm-svn: 263491
* Update to include the new header file providing createGVNPass.Chandler Carruth2016-03-111-0/+1
| | | | llvm-svn: 263210
* Make TargetInfo store an actual DataLayout instead of a string.James Y Knight2016-03-041-6/+6
| | | | | | | | | | | | | | Use it to calculate UserLabelPrefix, instead of specifying it (often incorrectly). Note that the *actual* user label prefix has always come from the DataLayout, and is handled within LLVM. The main thing clang's TargetInfo::UserLabelPrefix did was to set the #define value. Having these be different from each-other is just silly. Differential Revision: http://reviews.llvm.org/D17183 llvm-svn: 262737
* [PGO] Change profile use cc1 option to handle IR level profilesRong Xu2016-03-021-0/+2
| | | | | | | | | | | | | | | | | | This patch changes cc1 option for PGO profile use from -fprofile-instr-use=<path> to -fprofile-instrument-use-path=<path>. -fprofile-instr-use=<path> is now a driver only option. In addition to decouple the cc1 option from the driver level option, this patch also enables IR level profile use. cc1 option handling now reads the profile header and sets CodeGenOpt ProfileUse (valid values are {None, Clang, LLVM} -- this is a common enum for -fprofile-instrument={}, for the profile instrumentation), and invoke the pipeline to enable the respective PGO use pass. Reviewers: silvas, davidxl Differential Revision: http://reviews.llvm.org/D17737 llvm-svn: 262515
* [PGO] clang cc1 option change to enable IR level instrumentationRong Xu2016-02-291-0/+6
| | | | | | | | | | | This patch expands cc1 option -fprofile-instrument= with a new value: -fprofile-instrument=llvm which enables IR level PGO instrumentation. Reviewers: davidxl, silvas Differential Revision: http://reviews.llvm.org/D17622 llvm-svn: 262239
* [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar ↵Kostya Serebryany2016-02-171-0/+1
| | | | | | to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too llvm-svn: 261159
* Teach clang to use the ThinLTO pipelineMehdi Amini2016-02-171-1/+2
| | | | | | | | | | | | | Summary: Use the new pipeline implemented in D17115 Reviewers: tejohnson Subscribers: joker.eph, cfe-commits Differential Revision: http://reviews.llvm.org/D17272 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261045
* Eliminate an unnecessary enum, use the LLVM version. NFCPaul Robinson2016-02-051-13/+1
| | | | llvm-svn: 259950
* [PGO] cc1 option name change for profile instrumentationRong Xu2016-02-041-1/+1
| | | | | | | | | | | | This patch changes cc1 option -fprofile-instr-generate to an enum option -fprofile-instrument={clang|none}. It also changes cc1 options -fprofile-instr-generate= to -fprofile-instrument-path=. The driver level option -fprofile-instr-generate and -fprofile-instr-generate= remain intact. This change will pave the way to integrate new PGO instrumentation in IR level. Review: http://reviews.llvm.org/D16730 llvm-svn: 259811
* Move DebugInfoKind into its own header to cut the cyclic dependency edge ↵Benjamin Kramer2016-02-021-1/+1
| | | | | | from Driver to Frontend. llvm-svn: 259489
* [ThinLTO] Leverage new in-place renaming supportTeresa Johnson2016-01-081-16/+33
| | | | | | | | | | | | Due to the new in-place renaming support added in r257174, we no longer need to invoke ThinLTO global renaming from clang. It will be invoked on the module in the FunctionImport pass (by an immediately following llvm commit). As a result, we don't need to load the FunctionInfoIndex as early, so that is moved down into EmitAssemblyHelper::EmitAssembly. llvm-svn: 257179
* [Driver] Add support for -fno-builtin-foo options.Chad Rosier2016-01-061-0/+7
| | | | | | | Addresses PR4941 and rdar://6756912. http://reviews.llvm.org/D15195 llvm-svn: 256937
OpenPOWER on IntegriCloud