summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* AMDGPU: Add frexp_mant + frexp_exp builtinsMatt Arsenault2016-03-301-0/+8
| | | | llvm-svn: 264960
* Silencing warnings from MSVC 2015 Update 2. Both of these changes silence ↵Aaron Ballman2016-03-302-2/+2
| | | | | | "C4334 '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)". NFC. llvm-svn: 264932
* For MS ABI, emit dllexport friend functions defined inline in classStephan Bergmann2016-03-302-7/+18
| | | | | | | | | | | | | | ...as that is apparently what MSVC does. This is an updated version of r263738, which had to be reverted in r263740 due to test failures. The original version had erroneously emitted functions that are defined in class templates, too (see the updated "Handle friend functions" code in EmitDeferredDecls, lib/CodeGen/ModuleBuilder.cpp). (The updated tests needed to be split out into their own dllexport-ms-friend.cpp because of the CHECK-NOTs which would have interfered with subsequent CHECK-DAGs in dllexport.cpp.) Differential Revision: http://reviews.llvm.org/D18430 llvm-svn: 264841
* [PGO] Move the instrumentation point closer to the value site.Betul Buyukkurt2016-03-291-3/+4
| | | | | | | | | For terminator instructions, the value profiling instrumentation happens in a basic block other than where the value site resides. This CR moves the instrumentation point prior to the value site. Mostly NFC. llvm-svn: 264783
* [OPENMP] Remove extra code transformation.Alexey Bataev2016-03-291-0/+24
| | | | | | | | | For better support of some specific GNU extensions some extra transformation of AST nodes were introduced. These transformations are very hard to handle. The code is improved in handling of these extensions by using captured expressions construct. llvm-svn: 264709
* [OPENMP] Allow runtime insert its own code inside OpenMP regions.Alexey Bataev2016-03-296-494/+593
| | | | | | | | | | Solution unifies interface of RegionCodeGenTy type to allow insert runtime-specific code before/after main codegen action defined in CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy for general OpenMP directives, but must be allowed to insert its own (required) code to support target specific codegen. llvm-svn: 264700
* [PGO] More comments how function pointers for indirect calls are mappedAdam Nemet2016-03-281-1/+3
| | | | | | | | | | | | | | | | to function names Summary: Hopefully this will make it easier for the next person to figure all this out... Reviewers: bogner, davidxl Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D18489 llvm-svn: 264681
* [lanai] Add Lanai backend to clang driver.Jacques Pienaar2016-03-281-0/+74
| | | | | | | | | | Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain. General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html). Differential Revision: http://reviews.llvm.org/D17002 llvm-svn: 264655
* Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."Alexey Bataev2016-03-286-582/+494
| | | | | | Reverting because of failed tests. llvm-svn: 264577
* [OPENMP] Allow runtime insert its own code inside OpenMP regions.Alexey Bataev2016-03-286-494/+582
| | | | | | | | | | Solution unifies interface of RegionCodeGenTy type to allow insert runtime-specific code before/after main codegen action defined in CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy for general OpenMP directives, but must be allowed to insert its own (required) code to support target specific codegen. llvm-svn: 264576
* Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."Alexey Bataev2016-03-286-519/+444
| | | | | | This reverts commit 3ee791165100607178073f14531a0dc90c622b36. llvm-svn: 264570
* [OPENMP] Allow runtime insert its own code inside OpenMP regions.Alexey Bataev2016-03-286-444/+519
| | | | | | | | | | Solution unifies interface of RegionCodeGenTy type to allow insert runtime-specific code before/after main codegen action defined in CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy for general OpenMP directives, but must be allowed to insert its own (required) code to support target specific codegen. llvm-svn: 264569
* Fix serialization/deserialization for __uuidofDavid Majnemer2016-03-281-1/+1
| | | | | | | | I broke this back in r264529 because I forgot to serialize the UuidAttr member. Fix this by replacing the UuidAttr with a StringRef which is properly serialized and deserialized. llvm-svn: 264562
* Use the correct alignment for uuid descriptorsDavid Majnemer2016-03-271-2/+2
| | | | | | | The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit builds: we should do the same if the linker picks the "wrong" COMDAT. llvm-svn: 264530
* Improve the representation of CXXUuidofExprDavid Majnemer2016-03-271-1/+1
| | | | | | | | Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to. This makes translating from __uuidof to the underlying constant a lot more straightforward. llvm-svn: 264529
* 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
OpenPOWER on IntegriCloud