summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP] Sema and parsing for 'target parallel for simd' pragmaKelvin Li2016-07-143-0/+18
| | | | | | | | This patch is to implement sema and parsing for 'target parallel for simd' pragma. Differential Revision: http://reviews.llvm.org/D22096 llvm-svn: 275365
* P0305R0: Semantic analysis and code generation for C++17 init-statement for ↵Richard Smith2016-07-141-0/+10
| | | | | | | | | | 'if' and 'switch': if (stmt; condition) { ... } Patch by Anton Bikineev! Some minor formatting and comment tweets by me. llvm-svn: 275350
* Add XRay flags to Clang. We implement two flags to control the XRay behaviour:Aaron Ballman2016-07-132-0/+24
| | | | | | | | | | | -fxray-instrument: enables XRay annotation of IR -fxray-instruction-threshold: configures the threshold for function size (looking at IR instructions), and allow LLVM to decide whether to add the nop sleds later on in the process. Also implements the related xray_always_instrument and xray_never_instrument function attributes. Patch by Dean Michael Berris. llvm-svn: 275330
* [OpenMP] Initial implementation of parse+sema for OpenMP clause ↵Carlo Bertolli2016-07-131-0/+1
| | | | | | | | 'is_device_ptr' of target http://reviews.llvm.org/D22070 llvm-svn: 275282
* [OpenMP] Initial implementation of parse+sema for clause use_device_ptr of ↵Carlo Bertolli2016-07-131-0/+1
| | | | | | | | | | | | | | 'target data' http://reviews.llvm.org/D21904 This patch is similar to the implementation of 'private' clause: it adds a list of private pointers to be used within the target data region to store the device pointers returned by the runtime. Please refer to the following document for a full description of what the runtime witll return in this case (page 10 and 11): https://github.com/clang-omp/OffloadingDesign I am happy to answer any question related to the runtime interface to help reviewing this patch. llvm-svn: 275271
* [OpenCL] Fix code generation of kernel pipe parameters.Alexey Bader2016-07-131-3/+5
| | | | | | | | | | | Improved test with user define structure pipe type case. Reviewers: Anastasia, pxli168 Subscribers: yaxunl, cfe-commits Differential revision: http://reviews.llvm.org/D21744 llvm-svn: 275259
* CodeGen: minor cleanup, NFCSaleem Abdulrasool2016-07-131-23/+9
| | | | | | | | Initialise more members in initializer lists. Invert the condition that had grown to be pretty confusing. The `_objc_empty_vtable` is only used on macOS <10.9. This simplifies the code. NFC. llvm-svn: 275241
* [MS ABI] Support throwing/catching __unaligned typesDavid Majnemer2016-07-121-7/+15
| | | | | | | | We need to mark the appropriate bits in ThrowInfo and HandlerType so that the personality routine can correctly handle qualification conversions. llvm-svn: 275154
* [Coverage] Do not map regions from system headersVedant Kumar2016-07-111-0/+8
| | | | | | | | | | | | | | | Do not assign source regions located within system headers file ID's, and do not construct counter mapping regions out of them. This makes coverage reports less cluttered and less mysterious. E.g using the "assert" macro doesn't cause assert.h to appear in reports, and it no longer shows the "assertion failed" branch as an uncovered region. It also makes coverage mapping sections a bit smaller (e.g a 1% reduction in a stage2 build of bin/llvm-as). llvm-svn: 275121
* [Coverage] Move logic to skip decl's into a helper (NFC)Vedant Kumar2016-07-112-9/+12
| | | | llvm-svn: 275120
* Prevent the creation of empty (forwarding) blocks resulting from nested ifs.Wolfgang Pieb2016-07-111-1/+13
| | | | | | | | | | | | | | | | | Summary: Nested if statements can generate empty BBs whose terminator branches unconditionally to its successor. These branches are not eliminated to help generate better line number information in some cases, but there is no reason to keep the empty blocks that result from nested ifs. Reviewers: mehdi_amini, dblaikie, echristo Subscribers: mehdi_amini, cfe-commits Differential review: http://reviews.llvm.org/D11360 llvm-svn: 275115
* [CodeGen] Treat imported static local variables as declarationsDavid Majnemer2016-07-112-4/+4
| | | | | | | Imported variables cannot really be definitions for the purposes of IR generation. llvm-svn: 275040
* AMDGPU: Export workitem builtinsJan Vesely2016-07-101-0/+28
| | | | | | | | Reviewers: tstellardAMD Differential Revision: http://reviews.llvm.org/D20299 llvm-svn: 275030
* Delete dead code.Sean Silva2016-07-101-1/+0
| | | | | | We were just setting DisableUnitAtATime to its default value. llvm-svn: 275005
* [MS ABI] Some code cleanupsDavid Majnemer2016-07-091-9/+6
| | | | | | | | Don't create unnecessary truncations if the result will not be used. Also prefer preforming math before the truncation, it makes it a little easier to reason about. llvm-svn: 274984
* CodeGen: tweak CFString section for COFF, ELFSaleem Abdulrasool2016-07-091-3/+1
| | | | | | | | | Place the structure data into `cfstring`. This both isolates the structures to permit coalescing in the future (by the linker) as well as ensures that it doesnt get marked as read-only data. The structures themselves are not read-only, only the string contents. llvm-svn: 274956
* [OpenCL] Add missing -cl-no-signed-zeros option into driverYaxun Liu2016-07-081-0/+2
| | | | | | | | | | | | Add OCL option -cl-no-signed-zeros to driver options. Also added to opencl.cl testcases. Patch by Aaron En Ye Shi. Differential Revision: http://reviews.llvm.org/D22067 llvm-svn: 274923
* [CodeGen] Use llvm::Type::getVectorNumElements instead of casting to ↵Craig Topper2016-07-083-7/+5
| | | | | | llvm::VectorType and calling getNumElements. This is equivalent and shorter. llvm-svn: 274823
* [X86] Reuse existing lambda and remove unnecessary argument from vector cmp ↵Craig Topper2016-07-081-16/+11
| | | | | | builtin handling. NFC llvm-svn: 274821
* [X86] Remove a couple calls to create V2F64 and V4F32 types for builtin ↵Craig Topper2016-07-081-29/+17
| | | | | | handling. Just get the type from the operand of the builtin instead. NFC llvm-svn: 274820
* [AST] Use ArrayRef in more interfacesDavid Majnemer2016-07-071-4/+2
| | | | | | | | | ArrayRef is a little better than passing around a pointer/length pair. No functional change is intended. llvm-svn: 274732
* Revert "Retry "Include debug info for nested structs and classes""Adrian McCarthy2016-07-062-14/+2
| | | | | | | | | | Reverting because it causes a test failure on build bots (Modules/ModuleDebugInfo.cpp). Failure does not reproduce locally. svn revision: rL274698 This reverts commit 3c5ed6599b086720aab5b8bd6941149d066806a6. llvm-svn: 274706
* Retry "Include debug info for nested structs and classes"Adrian McCarthy2016-07-062-2/+14
| | | | | | | | | | This should work now that the LLVM-side of the change has landed successfully. Original Differential Revision: http://reviews.llvm.org/D21705 This reverts commit a30322e861c387e1088f47065d0438c6bb019879. llvm-svn: 274698
* [CodeGen, DebugInfo] Use hasLocalLinkage instead of hasInternalLinkageDavid Majnemer2016-07-061-3/+3
| | | | | | | | For the purpose of emitting debug info, entities with private linkage should be treated the same as internal linkage. While this doesn't change anything in practice, it makes the code a little less confusing. llvm-svn: 274677
* Revert "Include debug info for nested structs and classes"Adrian McCarthy2016-07-062-14/+2
| | | | | | This reverts commit 0af5ee9631c7c167dc40498b415876553e314c95. llvm-svn: 274633
* Include debug info for nested structs and classesAdrian McCarthy2016-07-062-2/+14
| | | | | | | | This includes nested types in the member list, even if there are no members of that type. Note that structs and classes have themselves as an "implicit struct" as the first member, so we skip implicit ones. Differential Revision: http://reviews.llvm.org/D21705 llvm-svn: 274628
* [X86] Use native IR for immediate values 0-7 of packed fp cmp builtins. This ↵Craig Topper2016-07-061-0/+45
| | | | | | makes them the same as what is done when using the SSE builtins for these same encodings. llvm-svn: 274608
* [OpenMP] Sema and parsing for 'distribute simd' pragmaKelvin Li2016-07-063-0/+17
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute simd'. Differential Revision: http://reviews.llvm.org/D22007 llvm-svn: 274604
* [AVX512] Use the generic ctlz intrinsic to implement the vplzcntd/q builtins.Craig Topper2016-07-061-0/+12
| | | | llvm-svn: 274603
* Delete some dead code, NFCVedant Kumar2016-07-061-10/+0
| | | | | | Found using clang's code coverage tool. llvm-svn: 274599
* [OpenCL] An implementation of device side enqueue (DSE) from OpenCL v2.0 ↵Anastasia Stulova2016-07-051-0/+142
| | | | | | | | | | | | | | | | | s6.13.17. - Added new Builtins: enqueue_kernel, get_kernel_work_group_size and get_kernel_preferred_work_group_size_multiple. These Builtins use custom check to diagnose parameters of the passed Blocks i. e. variable number of 'local void*' type params, and check different overloads specified in Table 6.31 of OpenCL v2.0. - IR is generated as an internal library call for each OpenCL Builtin, reusing ObjC Block implementation. Review: http://reviews.llvm.org/D20249 llvm-svn: 274540
* [OpenMP] Sema and parse for 'distribute parallel for simd'Kelvin Li2016-07-053-0/+17
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute parallel for simd'. Differential Revision: http://reviews.llvm.org/D21977 llvm-svn: 274530
* [OpenCL] Make OpenCL Builtins added according to the right version.Anastasia Stulova2016-07-041-1/+1
| | | | | | | | | | Currently we only have OpenCL 2.0 Builtins i.e. pipes or address space conversions. They have to be added only in the version 2.0 compilation mode to make the identifiers available for use in the other versions. Review: http://reviews.llvm.org/D20249 llvm-svn: 274509
* [AVX512] Modify what indices we emit for the zero vector we use for zero ↵Craig Topper2016-07-041-1/+1
| | | | | | extension of the result of a v2i1 or v4i1 masked compare. This way we emit something that the backend easily interprets as a concatenation rather than a true shuffle. This delivers slightly better codegen with the current backend capabilities. llvm-svn: 274484
* [CUDA] Move argument type lists to the stack. NFC.Benjamin Kramer2016-07-021-4/+4
| | | | llvm-svn: 274433
* Use arrays or initializer lists to feed ArrayRefs instead of SmallVector ↵Benjamin Kramer2016-07-024-74/+47
| | | | | | | | where possible. No functionality change intended llvm-svn: 274432
* PR28394: For compatibility with c++11 and c++14, if a static constexpr dataRichard Smith2016-07-021-1/+13
| | | | | | | | member is redundantly redeclared outside the class definition in code built in c++17 mode, ensure we emit a non-discardable definition of the data member for c++11 and c++14 compilations to use. llvm-svn: 274416
* [CodeView] Include MSVC style names for unnamed typesDavid Majnemer2016-07-011-9/+45
| | | | | | | | The CodeView printer expects to be able to generate fully qualified names from the debug info graph. This means that we need to include the MSVC-style name in the debug info for anonymous types. llvm-svn: 274401
* [Temporary, Lifetime] Add lifetime marks for temporariesTim Shen2016-07-015-20/+41
| | | | | | | | | With all MaterializeTemporaryExprs coming with a ExprWithCleanups, it's easy to add correct lifetime.end marks into the right RunCleanupsScope. Differential Revision: http://reviews.llvm.org/D20499 llvm-svn: 274385
* Emit more intrinsics for builtin functionsMatt Arsenault2016-07-011-39/+92
| | | | | | | | | | | | This is important for building libclc. Since r273039 tests are failing due to now emitting calls to these functions instead of emitting the DAG node. The libm function names are implemented for OpenCL, and should call the locally defined versions, so -fno-builtin is used. The IR Some functions use the __builtins and expect the intrinsics to be emitted. Without this we end up with nobuiltin calls to intrinsics or to unsupported library calls. llvm-svn: 274370
* [DebugInfo] Set DISubprogram ThisAdjustment in the MS ABIReid Kleckner2016-07-013-7/+17
| | | | llvm-svn: 274326
* fix typo; NFCSanjay Patel2016-06-301-1/+1
| | | | llvm-svn: 274278
* [CUDA] Give templated device functions internal linkage, templated kernels ↵Justin Lebar2016-06-301-3/+12
| | | | | | | | | | | | | | | | | external linkage. Summary: This lets LLVM perform IPO over these functions. In particular, it allows LLVM to emit ld.global.nc for loads to __restrict pointers in kernels that are never written to. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: http://reviews.llvm.org/D21337 llvm-svn: 274261
* [codeview] Emit qualified display names if -gline-tables-only is onReid Kleckner2016-06-301-4/+14
| | | | | | | | | | | | | | | | | | When -gmlt is on, we don't emit namespace or class scope information, and the CodeView emission code in LLVM can't compute the fully qualified name. If we know LLVM won't be able to get the name right, go ahead and emit the qualified name in the frontend. We could change our -gmlt emission strategy to include those scopes when emitting codeview, but that would increase memory usage and slow down LTO and add more complexity to debug info emission. The same problem exists when you debug a -gmlt binary with GDB, so we should consider removing '&& EmitCodeView' from the condition here at some point in the future after evaluating the impact on object file size. llvm-svn: 274246
* AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.Nikolay Haustov2016-06-305-3/+22
| | | | | | | | | | | | | | | | | | Summary: Summary: Change Clang calling convention SpirKernel to OpenCLKernel. Set calling convention OpenCLKernel for amdgcn as well. Add virtual method .getOpenCLKernelCallingConv() to TargetCodeGenInfo and use it to set target calling convention for AMDGPU and SPIR. Update tests. Reviewers: rsmith, tstellarAMD, Anastasia, yaxunl Subscribers: kzhuravl, cfe-commits Differential Revision: http://reviews.llvm.org/D21367 llvm-svn: 274220
* [CodeView] Implement support for bitfields in ClangDavid Majnemer2016-06-302-37/+63
| | | | | | | | | | | Emit the underlying storage offset in addition to the starting bit position of the field. This fixes PR28162. Differential Revision: http://reviews.llvm.org/D21783 llvm-svn: 274201
* Re-land "[MS] Don't expect vftables to be provided for extern template ↵Reid Kleckner2016-06-291-3/+7
| | | | | | | | | | | | | | instantiations" Reverts r273305 and re-instates r273296. We needed to fix a bug in Sema::MarkVTableUsed to ensure that operator delete lookup occurs when the vtable is referenced. We already had a special case to look up operator delete when dllimport was used, but I think should really mark virtual destructors referenced any time the vtable is used. llvm-svn: 274147
* [AVX512] Zero extend cmp intrinsic return value.Igor Breger2016-06-291-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D21746 llvm-svn: 274110
* Revert "[Coverage] Adopt llvm::coverage::encodeFilenamesAndRawMappings (NFC)"Vedant Kumar2016-06-291-10/+18
| | | | | | | | | This reverts commit 161ff9db3a3d0d62880d1cb18d58182cd3034912 (r273056). This is breaking stage2 instrumented builds with "malformed coverage data" errors. llvm-svn: 274104
* [Diag] Add getter shouldAlwaysPrint. NFCAdam Nemet2016-06-291-3/+3
| | | | | | | | | | For the new hotness attribute, the API will take the pass rather than the pass name so we can no longer play the trick of AlwaysPrint being a special pass name. This adds a getter to help the transition. There is also a corresponding llvm patch. llvm-svn: 274101
OpenPOWER on IntegriCloud