summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* CGLoopInfo: Use the MD_loop metadata kind from r264371, NFCDuncan P. N. Exon Smith2016-03-251-1/+1
| | | | | | | Besides a small compile-time speedup, there should be no real functionality change here. llvm-svn: 264372
* Attach profile summary information to Module.Easwaran Raman2016-03-241-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D18289 llvm-svn: 264342
* Revert "Recommitted r263425 "Supporting all entities declared in lexical ↵Reid Kleckner2016-03-243-59/+14
| | | | | | | | | | | scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)." This reverts commit r264281. This change breaks building Chromium for iOS. We'll upload a reproducer to the PR soon. llvm-svn: 264333
* Recommitted r263425 "Supporting all entities declared in lexical scope in ↵Amjad Aboud2016-03-243-14/+59
| | | | | | | | | | LLVM debug info." After fixing PR26942 (the fix is included in this commit). Differential Revision: http://reviews.llvm.org/D18350 llvm-svn: 264281
* [OpenCL] Add ocl and spir version for spir targetXiuli Pan2016-03-241-0/+44
| | | | | | | | | | | | Summary: Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits, pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D17596 llvm-svn: 264241
* Add missing __builtin_bitreverse8Matt Arsenault2016-03-231-0/+1
| | | | | | Also add documentation for bitreverse builtins llvm-svn: 264203
* Fix warning about extra semicolon. NFC.Vasileios Kalintiris2016-03-221-1/+1
| | | | llvm-svn: 264035
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-224-6/+471
| | | | | | | | | | | | | | Summary: This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 Reworked test case after buildbot failure on windows. Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp. llvm-svn: 264018
* [CUDA] Implement atomicInc and atomicDec builtinsJustin Lebar2016-03-221-0/+16
| | | | | | | | | | | | | | | These functions cannot be implemented as atomicrmw or cmpxchg instructions, so they are implemented as a call to the NVVM intrinsics @llvm.nvvm.atomic.load.inc.32.p0i32 and @llvm.nvvm.atomic.load.dec.32.p0i32. Patch by Jason Henline. Reviewers: jlebar Differential Revision: http://reviews.llvm.org/D18322 llvm-svn: 264009
* Revert "Convert some ObjC msgSends to runtime calls."Pete Cooper2016-03-213-106/+18
| | | | | | | | | | | | | | This reverts commit r263607. This change caused more objc_retain/objc_release calls in the IR but those are then incorrectly optimized by the ARC optimizer. Work is going to have to be done to ensure the ARC optimizer doesn't optimize user written RR, but that should land before this change. This change will also need to be updated to take account for any changes required to ensure that user written calls to RR are distinct from those inserted by ARC. llvm-svn: 263984
* [Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3)Faisal Vali2016-03-211-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement lambda capture of *this by copy. For e.g.: struct A { int d = 10; auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; } }; auto L = A{}.foo(); // A{}'s lifetime is gone. // Below is still ok, because *this was captured by value. assert(L(10) == 20); assert(L(100) == 120); If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined. Implementation Strategy: - amend the parser to accept *this in the lambda introducer - add a new king of capture LCK_StarThis - teach Sema::CheckCXXThisCapture to handle by copy captures of the enclosing object (i.e. *this) - when CheckCXXThisCapture does capture by copy, the corresponding initializer expression for the closure's data member direct-initializes it thus making a copy of '*this'. - in codegen, when assigning to CXXThisValue, if *this was captured by copy, make sure it points to the corresponding field member, and not, unlike when captured by reference, what the field member points to. - mark feature as implemented in svn Much gratitude to Richard Smith for his carefully illuminating reviews! llvm-svn: 263921
* P0184R0: Allow types of 'begin' and 'end' expressions in range-based for ↵Richard Smith2016-03-202-2/+4
| | | | | | loops to differ. llvm-svn: 263895
* [TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.Manman Ren2016-03-181-2/+10
| | | | | | | | | | This makes sure we don't generate a lot of code to spill/reload CSRs when calling tls_init from the access functions. This helps performance when tls_init is not inlined into the access functions. llvm-svn: 263854
* [OPENMP] Implementation of codegen for firstprivate clause of target directiveCarlo Bertolli2016-03-181-0/+1
| | | | | | | | | | | | | | | This patch implements the following aspects: It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user. It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices. It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side. Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend. It adds a check in sema regression tests for target map, firstprivate, and private clauses. http://reviews.llvm.org/D18203 llvm-svn: 263837
* Add -fnative-half-arguments-and-returnsPirama Arumuga Nainar2016-03-181-2/+2
| | | | | | | | | | | | | | | | | | Summary: r246764 handled __fp16 arguments and returns for AAPCS, but skipped this handling for OpenCL. Simlar to OpenCL, RenderScript also handles __fp16 type natively. This patch adds the -fnative-half-arguments-and-returns command line flag to allow such languages to skip this coercion of __fp16. Reviewers: srhines, olista01 Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18138 llvm-svn: 263795
* Revert r263783 as buildbot failure is being investigated.Arpith Chacko Jacob2016-03-184-466/+6
| | | | llvm-svn: 263784
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-184-6/+466
| | | | | | | | | | | | | Summary: Reworked test case after buildbot failure on windows. This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 llvm-svn: 263783
* Revert "For MS ABI, emit dllexport friend functions defined inline in class"Reid Kleckner2016-03-172-17/+7
| | | | | | | | | This reverts commit r263738. This appears to cause a failure in CXX/temp/temp.decls/temp.friend/p1.cpp llvm-svn: 263740
* For MS ABI, emit dllexport friend functions defined inline in classReid Kleckner2016-03-172-7/+17
| | | | | | | | | | | | Summary: ...as that is apparently what MSVC does Reviewers: rnk Patch by Stephan Bergmann Differential Revision: http://reviews.llvm.org/D15267 llvm-svn: 263738
* [OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.Alexey Bataev2016-03-173-32/+184
| | | | | | | | OpenMP 4.0 allows to define custom reduction operations using '#pragma omp declare reduction' construct. Patch allows to use this custom defined reduction operations in 'reduction' clauses. llvm-svn: 263701
* [OPENMP] Support for codegen of private clause of target, host sideCarlo Bertolli2016-03-161-1/+5
| | | | | | | | This patch adds support for codegen of private clause of target and a regression test for host code generation, when the host is used as target device. I believe that code generation for nvptx backend would not require anything additional or different to what is done for the host. http://reviews.llvm.org/D18105 llvm-svn: 263654
* Add attributes for preserve_mostcc/preserve_allcc calling conventions to the ↵Roman Levenstein2016-03-161-0/+8
| | | | | | | | | | | | | | | C/C++ front-end Till now, preserve_mostcc/preserve_allcc calling convention attributes were only available at the LLVM IR level. This patch adds attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end. The code was mostly written by Juergen Ributzka. I just added support for the AArch64 target and tests. Differential Revision: http://reviews.llvm.org/D18025 llvm-svn: 263647
* Directly get the canonical Type instead of going around through a ↵Yaron Keren2016-03-161-1/+1
| | | | | | CanQualType temporary, NFC. llvm-svn: 263635
* Convert some ObjC msgSends to runtime calls.Pete Cooper2016-03-163-18/+106
| | | | | | | | | | | | | | It is faster to directly call the ObjC runtime for methods such as retain/release instead of sending a message to those functions. This patch adds support for converting messages to retain/release/alloc/autorelease to their equivalent runtime calls. Tests included for the positive case of applying this transformation, negative tests that we ensure we only convert "alloc" to objc_alloc, not "alloc2", and also a driver test to ensure we enable this only for supported runtime versions. Reviewed by John McCall. Differential Revision: http://reviews.llvm.org/D14737 llvm-svn: 263607
* Revert commit http://reviews.llvm.org/D17877 to fix tests on x86.Arpith Chacko Jacob2016-03-154-466/+6
| | | | llvm-svn: 263589
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-154-6/+466
| | | | | | | | | | | Summary: This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 llvm-svn: 263587
* [cfi] Don't emit checks for disabled CFI kinds.Evgeniy Stepanov2016-03-151-8/+7
| | | | | | | | | | | | | | In the cross-DSO CFI mode clang emits __cfi_check_fail that handles errors triggered from other modules with targets in the current module. With this change, __cfi_check_fail will handle errors for CFI kinds that are not enabled in the current module as if they have the trapping behaviour (-fsanitize-trap=...). This fixes a bug where some combinations of -fsanitize* flags may result in a link failure due to a missing sanitizer runtime library for the diagnostic calls in __cfi_check_fail. llvm-svn: 263578
* Reverted http://reviews.llvm.org/D17877 to fix tests.Arpith Chacko Jacob2016-03-154-466/+6
| | | | llvm-svn: 263555
* [OpenMP] Base support for target directive codegen on NVPTX device.Arpith Chacko Jacob2016-03-154-6/+466
| | | | | | | | | | | Summary: This patch adds base support for codegen of the target directive on the NVPTX device. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D17877 llvm-svn: 263552
* [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
* CodeGen: Use 32-bit gep offsets to address vtable address points.Peter Collingbourne2016-03-142-5/+5
| | | | | | | | | | | | | | | | | The relative vtable ABI will use a struct rather than an array as the type of a vtable. LLVM only allows 32-bit integers as struct indices, so we need to use 32-bit integers to get addresses of address points. In order to keep the code simple, we might as well do that unconditionally. It's probably a reasonable implementation limit to support no more than 2 billion virtual functions per class. This change causes quite a bit of churn in the test suite, so I'm making it separately. Differential Revision: http://reviews.llvm.org/D18113 llvm-svn: 263469
* CodeGen: Mark functions used in vtables as unnamed_addr.Peter Collingbourne2016-03-142-6/+10
| | | | | | | | | | | This marks virtual function declarations, as well as runtime library functions __cxa_pure_virtual, __cxa_deleted_virtual and _purecall, as unnamed_addr. This will allow us to correctly form relative references to them from vtables in the relative vtable ABI. Differential Revision: http://reviews.llvm.org/D18071 llvm-svn: 263464
* Revert "Recommitted r261634 "Supporting all entities declared in lexical ↵Benjamin Kramer2016-03-143-59/+14
| | | | | | | | scope in LLVM debug info." After fixing PR26715 at r263379." This reverts commit r263425. Breaks self-host. llvm-svn: 263436
* Recommitted r261634 "Supporting all entities declared in lexical scope in ↵Amjad Aboud2016-03-143-14/+59
| | | | | | | | LLVM debug info." After fixing PR26715 at r263379. llvm-svn: 263425
* Remove compile time PreserveName in favor of a runtime cc1 ↵Mehdi Amini2016-03-135-37/+11
| | | | | | | | | | | | | | | | | | | | -discard-value-names option Summary: This flag is enabled by default in the driver when NDEBUG is set. It is forwarded on the LLVMContext to discard all value names (but GlobalValue) for performance purpose. This an improved version of D18024 Reviewers: echristo, chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18127 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263394
* Temporarily revert these patches:Eric Christopher2016-03-125-15/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 60d9845f6a037122d9be9a6d92d4de617ef45b04 Author: Mehdi Amini <mehdi.amini@apple.com> Date: Fri Mar 11 18:48:02 2016 +0000 Fix clang crash: when CodeGenAction is initialized without a context, use the member and not the parameter From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263273 91177308-0d34-0410-b5e6-96231b3b80d8 commit af7ce3bf04a75ad5124b457b805df26006bd215b Author: Mehdi Amini <mehdi.amini@apple.com> Date: Fri Mar 11 17:32:58 2016 +0000 Fix build: use -> with pointers and not . Silly typo. From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263267 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0eea119192814954e7368c77d0dc5a9eeec1fbb Author: Mehdi Amini <mehdi.amini@apple.com> Date: Fri Mar 11 17:15:44 2016 +0000 Remove compile time PreserveName switch based on NDEBUG Summary: Following r263086, we are now relying on a flag on the Context to discard Value names in release builds. Reviewers: chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18024 From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263257 91177308-0d34-0410-b5e6-96231b3b80d8 until we can fix the Release builds. This reverts commits 263257, 263267, 263273 llvm-svn: 263320
* Fix clang crash: when CodeGenAction is initialized without a context, use ↵Mehdi Amini2016-03-111-1/+1
| | | | | | | the member and not the parameter From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263273
* [SEH] Remove nounwind/noinline from outlined finally funcletsReid Kleckner2016-03-111-6/+0
| | | | | | With the new EH representation this is no longer necessary. llvm-svn: 263269
* Fix build: use -> with pointers and not .Mehdi Amini2016-03-111-1/+1
| | | | | | | Silly typo. From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263267
* Remove compile time PreserveName switch based on NDEBUGMehdi Amini2016-03-115-36/+15
| | | | | | | | | | | | | | | Summary: Following r263086, we are now relying on a flag on the Context to discard Value names in release builds. Reviewers: chandlerc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18024 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 263257
* Update to include the new header file providing createGVNPass.Chandler Carruth2016-03-111-0/+1
| | | | llvm-svn: 263210
* Add a coerce-and-expand ABIArgInfo as a generalization of someJohn McCall2016-03-113-5/+136
| | | | | | | | of the things we do with Expand / Direct. NFC for now, but this will be used by swiftcall expansion. llvm-svn: 263192
* Preserve ExtParameterInfos into CGFunctionInfo.John McCall2016-03-1116-193/+294
| | | | | | | | | As part of this, make the function-arrangement interfaces a little simpler and more semantic. NFC. llvm-svn: 263191
* EmitCXXStructorCall -> EmitCXXDestructorCall. NFC.Alexey Samsonov2016-03-103-20/+18
| | | | | | | This function is only used in Microsoft ABI and only to emit destructors. Rename/simplify it accordingly. llvm-svn: 263081
* Remove unused function arguments. NFC.Alexey Samsonov2016-03-101-8/+8
| | | | llvm-svn: 263080
* [PPC] FE support for generating VSX [negated] absolute value instructionsKit Barton2016-03-091-0/+10
| | | | | | | | | | Includes new built-in, conversion of built-in to target-independent intrinsic and update in the header file. Tests are also updated. There is a second part in the backend for which I will post a separate code-review. BACKEND PART SHOULD BE COMMITTED FIRST. Phabricator: http://reviews.llvm.org/D17816 llvm-svn: 263051
* [OPENMP 4.5] Codegen for data members in 'linear' clauseAlexey Bataev2016-03-092-29/+71
| | | | | | | | OpenMP 4.5 allows privatization of non-static data members in OpenMP constructs. Patch adds proper codegen support for data members in 'linear' clause llvm-svn: 263003
* [OPENMP 4.5] Codegen for data members in 'linear' clause.Alexey Bataev2016-03-091-15/+2
| | | | | | | OpenMP 4.5 allows to use data members in private clauses. Patch adds codegen support for 'linear' clause. llvm-svn: 263002
OpenPOWER on IntegriCloud