summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective"Julie Hockett2018-05-092-4/+2
| | | | | | This reverts commit r331904 because of a memory leak. llvm-svn: 331932
* [Clang] Implement function attribute no_stack_protector.Manoj Gupta2018-05-091-6/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: This attribute tells clang to skip this function from stack protector when -stack-protector option is passed. GCC option for this is: __attribute__((__optimize__("no-stack-protector"))) and the equivalent clang syntax would be: __attribute__((no_stack_protector)) This is used in Linux kernel to selectively disable stack protector in certain functions. Reviewers: aaron.ballman, rsmith, rnk, probinson Reviewed By: aaron.ballman Subscribers: probinson, srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D46300 llvm-svn: 331925
* [clang] Adding CharacteristicKind to PPCallbacks::InclusionDirectiveJulie Hockett2018-05-092-2/+4
| | | | | | | | | | | Adding a SrcMgr::CharacteristicKind parameter to the InclusionDirective in PPCallbacks, and updating calls to that function. This will be useful in https://reviews.llvm.org/D43778 to determine which includes are system headers. Differential Revision: https://reviews.llvm.org/D46614 llvm-svn: 331904
* [OPENMP] Generate unique names for offloading regions id.Alexey Bataev2018-05-091-1/+1
| | | | | | | It is required to emit unique names for offloading regions ids. Required to support compilation and linking of several compilation units. llvm-svn: 331899
* [OpenCL] Fix typos in emitted enqueue kernel function namesYaxun Liu2018-05-091-4/+4
| | | | | | | | | | Two typos: vaarg => vararg get_kernel_preferred_work_group_multiple => get_kernel_preferred_work_group_size_multiple Differential Revision: https://reviews.llvm.org/D46601 llvm-svn: 331895
* [OPENMP] Mark global tors/dtors as used.Alexey Bataev2018-05-091-0/+2
| | | | | | | | | | | If the global variables are marked as declare target and they need ctors/dtors, these ctors/dtors are emitted and then invoked by the offloading runtime library. They are not explicitly used in the emitted code and thus can be optimized out. Patch marks these functions as used, so the optimizer cannot remove these function during the optimization phase. llvm-svn: 331879
* Revert r331843 "[DebugInfo] Generate debug information for labels."Hans Wennborg2018-05-093-39/+0
| | | | | | | | | | | | | | | | It broke the Chromium build (see reply on the review). > Generate DILabel metadata and call llvm.dbg.label after label > statement to associate the metadata with the label. > > Differential Revision: https://reviews.llvm.org/D45045 > > Patch by Hsiangkai Wang. This doesn't revert the change to backend-unsupported-error.ll that seems to correspond to an llvm-side change. llvm-svn: 331861
* [DebugInfo] Generate debug information for labels.Shiva Chen2018-05-093-0/+39
| | | | | | | | | | | Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadata with the label. Differential Revision: https://reviews.llvm.org/D45045 Patch by Hsiangkai Wang. llvm-svn: 331843
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-0934-522/+522
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [OPENMP, NVPTX] Fix linkage of the global entries.Alexey Bataev2018-05-081-5/+5
| | | | | | | The linkage of the global entries must be weak to enable support of redefinition of the same target regions in multiple compilation units. llvm-svn: 331768
* Fix 'not all control paths return a value' MSVC warnings. NFCI.Simon Pilgrim2018-05-081-0/+1
| | | | llvm-svn: 331753
* [C++2a] Implement operator<=>: Address bugs and post-commit review comments ↵Eric Fiselier2018-05-081-1/+1
| | | | | | | | | | | | after r331677. This patch addresses some mostly trivial post-commit review comments received on r331677. Additionally, this patch fixes an assertion in `getNarrowingKind` caused by the use of an uninitialized value from `checkThreeWayNarrowingConversion`. llvm-svn: 331707
* [C++2a] Implement operator<=> CodeGen and ExprConstantEric Fiselier2018-05-071-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch tackles long hanging fruit for the builtin operator<=> expressions. It is currently needs some cleanup before landing, but I want to get some initial feedback. The main changes are: * Lookup, build, and store the required standard library types and expressions in `ASTContext`. By storing them in ASTContext we don't need to store (and duplicate) the required expressions in the BinaryOperator AST nodes. * Implement [expr.spaceship] checking, including diagnosing narrowing conversions. * Implement `ExprConstant` for builtin spaceship operators. * Implement builitin operator<=> support in `CodeGenAgg`. Initially I emitted the required comparisons using `ScalarExprEmitter::VisitBinaryOperator`, but this caused the operand expressions to be emitted once for every required cmp. * Implement [builtin.over] with modifications to support the intent of P0946R0. See the note on `BuiltinOperatorOverloadBuilder::addThreeWayArithmeticOverloads` for more information about the workaround. Reviewers: rsmith, aaron.ballman, majnemer, rnk, compnerd, rjmccall Reviewed By: rjmccall Subscribers: rjmccall, rsmith, aaron.ballman, junbuml, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D45476 llvm-svn: 331677
* [OPENMP, NVPTX] Codegen for critical construct.Alexey Bataev2018-05-072-0/+70
| | | | | | Added correct codegen for the critical construct on NVPTX devices. llvm-svn: 331652
* [OPENMP, NVPTX] Added support for L2 parallelism.Alexey Bataev2018-05-074-127/+384
| | | | | | | Added initial codegen for level 2, 3 etc. parallelism. Currently, all the second, the third etc. parallel regions will run sequentially. llvm-svn: 331642
* [ThinLTO] Support opt remarks options with distributed ThinLTO backendsTeresa Johnson2018-05-051-1/+3
| | | | | | | | | | | | | | | | | Summary: Passes down the necessary code ge options to the LTO Config to enable -fdiagnostics-show-hotness and -fsave-optimization-record in the ThinLTO backend for a distributed build. Also, remove warning about not having PGO when the input is IR. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D46464 llvm-svn: 331592
* [Coroutines] Catch exceptions in await_resumeBrian Gesiak2018-05-041-3/+45
| | | | | | | | | | | | | | | | | | | | | Summary: http://wg21.link/P0664r2 section "Evolution/Core Issues 24" describes a proposed change to Coroutines TS that would have any exceptions thrown after the initial suspend point of a coroutine be caught by the handler specified by the promise type's 'unhandled_exception' member function. This commit provides a sample implementation of the specified behavior. Test Plan: `check-clang` Reviewers: GorNishanov, EricWF Reviewed By: GorNishanov Subscribers: cfe-commits, lewissbaker, eric_niebler Differential Revision: https://reviews.llvm.org/D45860 llvm-svn: 331519
* [CodeGenFunction] Use the StringRef::split function that takes a char ↵Craig Topper2018-05-031-2/+2
| | | | | | | | separator instead of StringRef separator. NFC The char separator version should be a little better optimized. llvm-svn: 331482
* Rename invariant.group.barrier to launder.invariant.groupPiotr Padlewski2018-05-033-7/+7
| | | | | | | | | | | | | | Summary: This is one of the initial commit of "RFC: Devirtualization v2" proposal: https://docs.google.com/document/d/16GVtCpzK8sIHNc2qZz6RN8amICNBtvjWUod2SujZVEo/edit?usp=sharing Reviewers: rsmith, amharc, kuhar, sanjoy Subscribers: arsenm, nhaehnle, javed.absar, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45111 llvm-svn: 331448
* Track the result of evaluating a computed noexcept specification on theRichard Smith2018-05-033-11/+7
| | | | | | | | | | | | | | FunctionProtoType. We previously re-evaluated the expression each time we wanted to know whether the type is noexcept or not. We now evaluate the expression exactly once. This is not quite "no functional change": it fixes a crasher bug during AST deserialization where we would try to evaluate the noexcept specification in a situation where we have not deserialized sufficient portions of the AST to permit such evaluation. llvm-svn: 331428
* [OPENMP] Add support for reductions on simd directives in targetAlexey Bataev2018-05-021-11/+47
| | | | | | | | regions. Added codegen for `simd reduction()` constructs in target directives. llvm-svn: 331393
* [OPENMP] Support C++ member functions in the device constructs.Alexey Bataev2018-05-023-12/+5
| | | | | | | Added correct emission of the C++ member functions for the device function when they are used in the device constructs. llvm-svn: 331365
* [OPENMP] Emit names of the globals depending on target.Alexey Bataev2018-05-023-74/+130
| | | | | | | | Some symbols are not allowed to be used as names on some targets. Patch ries to unify the emission of the names of LLVM globals so they could be used on different targets. llvm-svn: 331358
* [OPENMP] Emit template instatiation|specialization functions forAlexey Bataev2018-05-011-1/+10
| | | | | | | | | | devices. If the function is an instantiation|specialization of the template and is used in the device code, the definitions of such functions should be emitted for the device. llvm-svn: 331261
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-013-1/+5
| | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. llvm-svn: 331244
* [CodeGen] Fix typo in comment form->from. NFCCraig Topper2018-04-301-1/+1
| | | | llvm-svn: 331231
* [Driver, CodeGen] rename options to disable an FP cast optimizationSanjay Patel2018-04-301-2/+4
| | | | | | | | | | | | | | As suggested in the post-commit thread for rL331056, we should match these clang options with the established vocabulary of the corresponding sanitizer option. Also, the use of 'strict' is well-known for these kinds of knobs, and we can improve the descriptive text in the docs. So this intends to match the logic of D46135 but only change the words. Matching LLVM commit to match this spelling of the attribute to follow shortly. Differential Revision: https://reviews.llvm.org/D46236 llvm-svn: 331209
* [OPENMP] Do not crash on codegen for CXX member functions.Alexey Bataev2018-04-301-0/+3
| | | | | | | Non-static member functions should not be emitted as a standalone functions, this leads to compiler crash. llvm-svn: 331206
* [OPENMP] Do not crash on incorrect input data.Alexey Bataev2018-04-301-11/+36
| | | | | | | | Emit error messages instead of compiler crashing when the target region does not exist in the device code + fix crash when the location comes from macros. llvm-svn: 331195
* PR37189 Fix incorrect end source location and spelling for a split '>>' token.Richard Smith2018-04-301-3/+3
| | | | | | | | | | | | | | | | | | When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an extension) when we do the same for other tokens starting with a '>', we can't just use a location pointing to the first '>' as the location of the split token, because that would result in our miscomputing the length and spelling for the token. As a consequence, for example, a refactoring replacing 'A<X>' with something else would sometimes replace one character too many, and similarly diagnostics highlighting a template-id source range would highlight one character too many. Fix this by creating an expansion range covering the first character of the '>>' token, whose spelling is '>'. For this to work, we generalize the expansion range of a macro FileID to be either a token range (the common case) or a character range (used in this new case). llvm-svn: 331155
* [Driver, CodeGen] add options to enable/disable an FP cast optimizationSanjay Patel2018-04-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | As discussed in the post-commit thread for: rL330437 ( http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20180423/545906.html ) We need a way to opt-out of a float-to-int-to-float cast optimization because too much existing code relies on the platform-specific undefined result of those casts when the float-to-int overflows. The LLVM changes associated with adding this function attribute are here: rL330947 rL330950 rL330951 Also as suggested, I changed the LLVM doc to mention the specific sanitizer flag that catches this problem: rL330958 Differential Revision: https://reviews.llvm.org/D46135 llvm-svn: 331041
* [ARM,AArch64] Add intrinsics for dot product instructionsOliver Stannard2018-04-271-0/+12
| | | | | | | | | | The ACLE spec which describes these intrinsics hasn't been published yet, but this is based on the final draft which will be published soon, and these have already been implemented by GCC. Differential revision: https://reviews.llvm.org/D46109 llvm-svn: 331039
* [OpenCL] Add separate read_only and write_only pipe IR typesSven van Haastregt2018-04-273-12/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | SPIR-V encodes the read_only and write_only access qualifiers of pipes, so separate LLVM IR types are required to target SPIR-V. Other backends may also find this useful. These new types are `opencl.pipe_ro_t` and `opencl.pipe_wo_t`, which replace `opencl.pipe_t`. This replaces __get_pipe_num_packets(...) and __get_pipe_max_packets(...) which took a read_only pipe with separate versions for read_only and write_only pipes, namely: * __get_pipe_num_packets_ro(...) * __get_pipe_num_packets_wo(...) * __get_pipe_max_packets_ro(...) * __get_pipe_max_packets_wo(...) These separate versions exist to avoid needing a bitcast to one of the two qualified pipe types. Patch by Stuart Brady. Differential Revision: https://reviews.llvm.org/D46015 llvm-svn: 331026
* [CodeGen] Avoid destructing a callee-destructued struct type in aAkira Hatanaka2018-04-274-3/+31
| | | | | | | | | | | | | | | | | | | | | | | function if a function delegates to another function. Fix a bug introduced in r328731, which caused a struct with ObjC __weak fields that was passed to a function to be destructed twice, once in the callee function and once in another function the callee function delegates to. To prevent this, keep track of the callee-destructed structs passed to a function and disable their cleanups at the point of the call to the delegated function. This reapplies r331016, which was reverted in r331019 because it caused an assertion to fail in EmitDelegateCallArg on a windows bot. I made changes to EmitDelegateCallArg so that it doesn't try to deactivate cleanups for structs that have trivial destructors (cleanups for those structs are never pushed to the cleanup stack in EmitParmDecl). rdar://problem/39194693 Differential Revision: https://reviews.llvm.org/D45382 llvm-svn: 331020
* Revert "[CodeGen] Avoid destructing a callee-destructued struct type in a"Akira Hatanaka2018-04-274-35/+3
| | | | | | | | This reverts commit r331016, which broke a windows bot. http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/11727 llvm-svn: 331019
* [CodeGen] Avoid destructing a callee-destructued struct type in aAkira Hatanaka2018-04-274-3/+35
| | | | | | | | | | | | | | | | | function if a function delegates to another function. Fix a bug introduced in r328731, which caused a struct with ObjC __weak fields that was passed to a function to be destructed twice, once in the callee function and once in another function the callee function delegates to. To prevent this, keep track of the callee-destructed structs passed to a function and disable their cleanups at the point of the call to the delegated function. rdar://problem/39194693 Differential Revision: https://reviews.llvm.org/D45382 llvm-svn: 331016
* [x86] Revert r330322 (& r330323): Lowering x86 adds/addus/subs/subus intrinsicsChandler Carruth2018-04-261-98/+1
| | | | | | | | The LLVM commit introduces a crash in LLVM's instruction selection. I filed http://llvm.org/PR37260 with the test case. llvm-svn: 330997
* Revert rC330794 and some dependent tiny bug fixes Faisal Vali2018-04-262-2/+0
| | | | | | | | | | | | | | See Richard's humbling feedback here: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226482.html http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180423/226486.html Wish I'd had the patience to solicit the feedback prior to committing :) Sorry for the noise guys. Thank you Richard for being the steward that clang deserves! llvm-svn: 330888
* [c++2a] [concepts] Add rudimentary parsing support for template concept ↵Faisal Vali2018-04-252-0/+2
| | | | | | | | | | | | | | declarations This patch is a tweak of changyu's patch: https://reviews.llvm.org/D40381. It differs in that the recognition of the 'concept' token is moved into the machinery that recognizes declaration-specifiers - this allows us to leverage the attribute handling machinery more seamlessly. See the test file to get a sense of the basic parsing that this patch supports. There is much more work to be done before concepts are usable... Thanks Changyu! llvm-svn: 330794
* [HIP] Add hip input kind and codegen for kernel launchingYaxun Liu2018-04-251-16/+42
| | | | | | | | | | | | | | | | | | | | | | | HIP is a language similar to CUDA (https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md ). The language syntax is very similar, which allows a hip program to be compiled as a CUDA program by Clang. The main difference is the host API. HIP has a set of vendor neutral host API which can be implemented on different platforms. Currently there is open source implementation of HIP runtime on amdgpu target (https://github.com/ROCm-Developer-Tools/HIP). This patch adds support of input kind and language standard hip. When hip file is compiled, both LangOpts.CUDA and LangOpts.HIP is turned on. This allows compilation of hip program as CUDA in most cases and only special handling of hip program is needed LangOpts.HIP is checked. This patch also adds support of kernel launching of HIP program using HIP host API. When -x hip is not specified, there is no behaviour change for CUDA. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44984 llvm-svn: 330790
* Link to AggressiveInstCombine in a few places. Unbreaks build for me.Roman Lebedev2018-04-241-0/+1
| | | | | | | | | | | | /usr/local/bin/ld.lld: error: undefined symbol: llvm::createAggressiveInstCombinerPass() >>> referenced by cc1_main.cpp >>> tools/clang/tools/driver/CMakeFiles/clang.dir/cc1_main.cpp.o:(_GLOBAL__sub_I_cc1_main.cpp) And so on The bot coverage is clearly missing. llvm-svn: 330694
* Fix build break due to content moving from Scalar.h to InstCombine.h in LLVMDavid Blaikie2018-04-241-0/+1
| | | | llvm-svn: 330671
* [OPENMP] Do not cast captured by value variables with pointer types inAlexey Bataev2018-04-231-1/+2
| | | | | | | | | | | NVPTX target. When generating the wrapper function for the offloading region, we need to call the outlined function and cast the arguments correctly to follow the ABI. Usually, variables captured by value are casted to `uintptr_t` type. But this should not performed for the variables with pointer type. llvm-svn: 330620
* [CodeGen] Reland r330442: Add an option to suppress output of llvm.identMikhail Maltsev2018-04-232-2/+4
| | | | | | | The test case in the original patch was overly contrained and failed on PPC targets. llvm-svn: 330575
* Use special new Clang flag 'FrontendTimesIsEnabled' instead of ↵Andrew V. Tischenko2018-04-232-11/+11
| | | | | | | | 'llvm::TimePassesIsEnabled' inside -ftime-report feature. Differential Revision: https://reviews.llvm.org/D45619 llvm-svn: 330571
* [Atomics] warn about atomic accesses using libcallsTim Northover2018-04-231-6/+10
| | | | | | | | | | | | If an atomic variable is misaligned (and that suspicion is why Clang emits libcalls at all) the runtime support library will have to use a lock to safely access it, with potentially very bad performance consequences. There's a very good chance this is unintentional so it makes sense to issue a warning. Also give it a named group so people can promote it to an error, or disable it if they really don't care. llvm-svn: 330566
* Revert r330442, CodeGen/no-ident-version.c is failing on PPCMikhail Maltsev2018-04-202-4/+2
| | | | llvm-svn: 330451
* [CUDA] Set LLVM calling convention for CUDA kernelYaxun Liu2018-04-203-0/+11
| | | | | | | | | | | | | | Some targets need special LLVM calling convention for CUDA kernel. This patch does that through a TargetCodeGenInfo hook. It only affects amdgcn target. Patch by Greg Rodgers. Revised and lit tests added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D45223 llvm-svn: 330447
* [CodeGen] Add an option to suppress output of llvm.identMikhail Maltsev2018-04-202-2/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: By default Clang outputs its version (including git commit hash, in case of trunk builds) into object and assembly files. It might be useful to have an option to disable this, especially for debugging purposes. This patch implements new command line flags -Qn and -Qy (the names are chosen for compatibility with GCC). -Qn disables output of the 'llvm.ident' metadata string and the 'producer' debug info. -Qy (enabled by default) does the opposite. Reviewers: faisalv, echristo, aprantl Reviewed By: aprantl Subscribers: aprantl, cfe-commits, JDevlieghere, rogfer01 Differential Revision: https://reviews.llvm.org/D45255 llvm-svn: 330442
* [CUDA] Register relocatable GPU binariesJonas Hahnfeld2018-04-201-19/+102
| | | | | | | | | | nvcc generates a unique registration function for each object file that contains relocatable device code. Unique names are achieved with a module id that is also reflected in the function's name. Differential Revision: https://reviews.llvm.org/D42922 llvm-svn: 330425
OpenPOWER on IntegriCloud