summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP] Revert rL256842: [OpenMP] Offloading descriptor registration and ↵Samuel Antao2016-01-0518-1713/+162
| | | | | | | | device codegen. It was causing two regression, so I'm reverting until the cause is found. llvm-svn: 256858
* [PGO] Enable clang to pass compiler-rt profile support library to linker on ↵Nathan Slingerland2016-01-052-0/+18
| | | | | | | | | | | | | | Windows Summary: This change enables clang to automatically link binaries built with the -fprofile-instr-generate against the clang_rt.profile-i386.lib library. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15833 llvm-svn: 256855
* [OpenMP] Allow file ID to be signed in the offloading metadata.Samuel Antao2016-01-052-6/+6
| | | | | | This fixes a regression introduced by rL256842. llvm-svn: 256854
* [OpenMP] Offloading descriptor registration and device codegen.Samuel Antao2016-01-0518-162/+1713
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In order to offloading work properly two things need to be in place: - a descriptor with all the offloading information (device entry functions, and global variable) has to be created by the host and registered in the OpenMP offloading runtime library. - all the device functions need to be emitted for the device and a convention has to be in place so that the runtime library can easily map the host ID of an entry point with the actual function in the device. This patch adds support for these two things. However, only entry functions are being registered given that 'declare target' directive is not yet implemented. About offloading descriptor: The details of the descriptor are explained with more detail in http://goo.gl/L1rnKJ. Basically the descriptor will have fields that specify the number of devices, the pointers to where the device images begin and end (that will be defined by the linker), and also pointers to a the begin and end of table whose entries contain information about a specific entry point. Each entry has the type: ``` struct __tgt_offload_entry{ void *addr; char *name; int64_t size; }; ``` and will be implemented in a pre determined (ELF) section `.omp_offloading.entries` with 1-byte alignment, so that when all the objects are linked, the table is in that section with no padding in between entries (will be like a C array). The code generation ensures that all `__tgt_offload_entry` entries are emitted in the same order for both host and device so that the runtime can have the corresponding entries in both host and device in same index of the table, and efficiently implement the mapping. The resulting descriptor is registered/unregistered with the runtime library using the calls `__tgt_register_lib` and `__tgt_unregister_lib`. The registration is implemented in a high priority global initializer so that the registration happens always before any initializer (that can potentially include target regions) is run. The driver flag -omptargets= was created to specify a comma separated list of devices the user wants to support so that the new functionality can be exercised. Each device is specified with its triple. About target codegen: The target codegen is pretty much straightforward as it reuses completely the logic of the host version for the same target region. The tricky part is to identify the meaningful target regions in the device side. Unlike other programming models, like CUDA, there are no already outlined functions with attributes that mark what should be emitted or not. So, the information on what to emit is passed in the form of metadata in host bc file. This requires a new option to pass the host bc to the device frontend. Then everything is similar to what happens in CUDA: the global declarations emission is intercepted to check to see if it is an "interesting" declaration. The difference is that instead of checking an attribute, the metadata information in checked. Right now, there is only a form of metadata to pass information about the device entry points (target regions). A class `OffloadEntriesInfoManagerTy` was created to manage all the information and queries related with the metadata. The metadata looks like this: ``` !omp_offload.info = !{!0, !1, !2, !3, !4, !5, !6} !0 = !{i32 0, i32 52, i32 77426347, !"_ZN2S12r1Ei", i32 479, i32 13, i32 4} !1 = !{i32 0, i32 52, i32 77426347, !"_ZL7fstatici", i32 461, i32 11, i32 5} !2 = !{i32 0, i32 52, i32 77426347, !"_Z9ftemplateIiET_i", i32 444, i32 11, i32 6} !3 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 99, i32 11, i32 0} !4 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 272, i32 11, i32 3} !5 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 127, i32 11, i32 1} !6 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 159, i32 11, i32 2} ``` The fields in each metadata entry are (in sequence): Entry 1) an ID of the type of metadata - right now only zero is used meaning "OpenMP target region". Entry 2) a unique ID of the device where the input source file that contain the target region lives. Entry 3) a unique ID of the file where the input source file that contain the target region lives. Entry 4) a mangled name of the function that encloses the target region. Entries 5) and 6) line and column number where the target region was found. Entry 7) is the order the entry was emitted. Entry 2) and 3) are required to distinguish files that have the same function name. Entry 4) is required to distinguish different instances of the same declaration (usually templated ones) Entries 5) and 6) are required to distinguish the particular target region in body of the function (it is possible that a given target region is not an entry point - if clause can evaluate always to zero - and therefore we need to identify the "interesting" target regions. ) This patch replaces http://reviews.llvm.org/D12306. Reviewers: ABataev, hfinkel, tra, rjmccall, sfantao Subscribers: FBrygidyn, piotr.rak, Hahnfeld, cfe-commits Differential Revision: http://reviews.llvm.org/D12614 llvm-svn: 256842
* clang-format: Fix corner case in "if it saves columns"-calculation.Daniel Jasper2016-01-052-2/+5
| | | | | | | | | | | | | | | Before: aaaa .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 256841
* [OpenCL] Disallow taking an address of a function.Anastasia Stulova2016-01-054-2/+24
| | | | | | | | | | | | An undecorated function designator implies taking the address of a function, which is illegal in OpenCL. Implementing a check for this earlier to allow the error to be reported even in the presence of other more obvious errors. Patch by Neil Hickey! http://reviews.llvm.org/D15691 llvm-svn: 256838
* clang-format: Handle \n the same way as std::endl with stream operator.Daniel Jasper2016-01-052-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang-format breaks multi-line streams after std::endl. It now also break for '\n', the suggested replacement for std::endl: http://llvm.org/docs/CodingStandards.html#avoid-std-endl Before: llvm::errs() << aaaaaaaaaaaaaaaaaaaaaa << '\n' << bbbbbbbbbbbbbbbbbbbbbb << '\n'; llvm::errs() << aaaa << "aaaaaaaaaaaaaaaaaa\n" << bbbb << "bbbbbbbbbbbbbbbbbb\n"; After: llvm::errs() << aaaaaaaaaaaaaaaaaaaaaa << '\n' << bbbbbbbbbbbbbbbbbbbbbb << '\n'; llvm::errs() << aaaa << "aaaaaaaaaaaaaaaaaa\n" << bbbb << "bbbbbbbbbbbbbbbbbb\n"; This changeset ensure that multiline streams have a line break after: - std::endl - '\n' - "\n" - "Some Text\n" Patch by Jean-Philippe Dufraigne, thank you. llvm-svn: 256832
* clang-format: Avoid creating hanging indents in call sequences.Daniel Jasper2016-01-052-2/+20
| | | | | | | | | | | | | | Before: aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaa) .aaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaaaaaaaaaaaaaa .aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa) .aaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 256831
* clang-format: Improve line wrapping behavior in call sequences.Daniel Jasper2016-01-054-14/+29
| | | | | | | | | | | | | | | r256750 has been leading to an undesired behavior: aaaaaaaaaa .aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); This change increases penalty for wrapping before member accesses that aren't calls. Thus, this is again formatted as (as it has been before r256750): aaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaaa.aaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 256830
* [AArch64] Teaches clang about Samsung Exynos-M1MinSeong Kim2016-01-056-2/+36
| | | | | | | | Adds core tuning support for new Samsung Exynos-M1 core (ARMv8-A). Differential Revision: http://reviews.llvm.org/D15664 llvm-svn: 256829
* [ARM] [AARCH64] Add CodeGen IR tests for {VS}QRDML{AS}H v8.1a intrinsics.Alexandros Lamprineas2016-01-052-78/+213
| | | | | | Differential Revision: http://reviews.llvm.org/D15223 llvm-svn: 256822
* Avoid walking all the declarations in the TU when a tag is declared in functionRichard Smith2016-01-051-6/+2
| | | | | | prototype scope in a function definition. llvm-svn: 256803
* Remove an unused parameterDavid Majnemer2016-01-053-8/+3
| | | | | | No functionality change is intended llvm-svn: 256797
* [ms-inline-asm] Handle dependent identifiers in inline asmDavid Majnemer2016-01-042-4/+38
| | | | | | | | | Build up a dependent expression for MS-style inline assembly if the identifier's type is dependent. This fixes PR26001. llvm-svn: 256795
* Remove setting of inlinehint and cold attributes based on profile dataEaswaran Raman2016-01-043-60/+2
| | | | | | | | | | | NFC. These hints are only used for inlining and the inliner now uses the same criteria to identify hot and cold callees and set appropriate thresholds without relying on these hints. Hence this removed code is superfluous. Differential Revision: http://reviews.llvm.org/D15726 llvm-svn: 256793
* Add some overlooked optnone tests, and tighten up an existing test.Paul Robinson2016-01-044-2/+353
| | | | | | Differential Revision: http://reviews.llvm.org/D15704 llvm-svn: 256762
* clang-format: [JS] Support more ES6 default exports.Daniel Jasper2016-01-042-2/+4
| | | | llvm-svn: 256759
* clang-format: [JS] Support ES6 exports of array literals.Daniel Jasper2016-01-042-1/+10
| | | | | | | | | | | | | | | | Before: export default[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb]; export default[]; After: export default [ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ]; export default []; llvm-svn: 256758
* clang-format: [JS] Improve empty array literal detection.Daniel Jasper2016-01-042-3/+5
| | | | | | | | | | | | | | | Previously, the [] in the following example were recognized as an array subscript leading to weird indentation. Before: var aaaa = aaaaa || // wrap []; After: var aaaa = aaaaa || // wrap []; llvm-svn: 256753
* clang-format: Fix corner case in builder-type call formatting.Daniel Jasper2016-01-042-1/+5
| | | | | | | | | | | | | | Before: return aaaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa) .aaaa(aaaaaaaaaaaaaa); After: return aaaaaaaaaaaaaaaa .aaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa) .aaaa(aaaaaaaaaaaaaa); llvm-svn: 256750
* Convert test/CXX/lex/lex.literal/lex.string/p4.cpp back to DOS lineDimitry Andric2016-01-041-17/+17
| | | | | | | endings, since the file is supposed to have them, according to its comments. Also set its svn:eol-style property. Noticed by Nico Weber. llvm-svn: 256742
* clang-format: Align long braced init lists even if they are nested inDaniel Jasper2016-01-042-4/+15
| | | | | | function calls. llvm-svn: 256740
* clang-format: Fix corner case for lambda assignments.Daniel Jasper2016-01-042-1/+3
| | | | | | | | | | | | Before: std::function<std::string(const std::string &)> my_lambda = []( const string &s) { return s; }; After: std::function<std::string(const std::string &)> my_lambda = [](const string &s) { return s; }; llvm-svn: 256739
* clang-format: Fix corner-case in ObjC method declaration formattingDaniel Jasper2016-01-043-9/+13
| | | | | | | | | | | | | | | | | | Before: - (void)shortf:(GTMFoo *)theFoo longKeyword:(NSRect)theRect longerKeyword:(float)theInterval error:(NSError **)theError { } After: - (void)shortf:(GTMFoo *)theFoo longKeyword:(NSRect)theRect longerKeyword:(float)theInterval error:(NSError **)theError { } llvm-svn: 256738
* clang-format: [Proto] Basic support for options with <> for repeated fields.Daniel Jasper2016-01-042-3/+10
| | | | llvm-svn: 256737
* clang-format: [Proto] Improve wrapping of message field attributes.Daniel Jasper2016-01-043-12/+30
| | | | | | | | | | | | | | | | | | | | | | | Before: optional AAA aaa = 1 [foo = { key: "a" // }, bar = { key: "a" // }]; After: optional AAA aaa = 1 [ foo = { key: "a" // }, bar = { key: "a" // } ]; llvm-svn: 256736
* [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects ↵Craig Topper2016-01-041-0/+3
| | | | | | in the support library will be deleted. llvm-svn: 256731
* ArrayRef-ize a function. NFCCraig Topper2016-01-031-6/+4
| | | | llvm-svn: 256718
* Use std::is_sorted instead of a manual loop. NFCCraig Topper2016-01-031-5/+1
| | | | llvm-svn: 256717
* [PGO] Cleanup: Use covmap header definition in the template fileXinliang David Li2016-01-032-15/+21
| | | | | | | | | | | | | | This is one last remaining instrumentatation related structure that needs to be migrate to use the centralized template definition. With this change, instrumentation code related to coverage module header will be kept in sync with the coverage mapping reader. The remaining code which makes implicit assumption about covmap control structure layout in the the lowering pass will cleaned up in a different patch. This patch is not intended to have no functional change. llvm-svn: 256714
* Fix several accidental DOS line endings in source filesDimitry Andric2016-01-0316-555/+555
| | | | | | | | | | | | | | | Summary: There are a number of files in the tree which have been accidentally checked in with DOS line endings. Convert these to native line endings. There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those. Reviewers: joerg, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D15849 llvm-svn: 256704
* Reimplement __readeflags and __writeeflags on top of intrinsicsDavid Majnemer2016-01-012-28/+11
| | | | | | | Lean on LLVM to provide this functionality now that it provides the necessary intrinsics. llvm-svn: 256686
* [TrailingObjects] Fix "Convert classes in OpenMPClause.h" for MSVCJames Y Knight2016-01-011-12/+12
| | | | | | | "friend class OMPVarListClause" -> "friend OMPVarListClause". It's a template, not a class. llvm-svn: 256684
* [TrailingObjects] Convert classes in OpenMPClause.hJames Y Knight2016-01-012-96/+87
| | | | llvm-svn: 256683
* [X86][PKU] add clang intrinsic for {RD|WR}PKRUAsaf Badouh2015-12-317-1/+81
| | | | | | Differential Revision: http://reviews.llvm.org/D15837 llvm-svn: 256672
* [OPENMP 4.5] Codegen for 'schedule' clause with monotonic/nonmonotonic ↵Alexey Bataev2015-12-316-195/+414
| | | | | | | | modifiers. OpenMP 4.5 adds support for monotonic/nonmonotonic modifiers in 'schedule' clause. Add codegen for these modifiers. llvm-svn: 256666
* [TrailingObjects] Fix bug in "Convert classes in ExprObjC.h"James Y Knight2015-12-311-1/+2
| | | | | | (Detected by asan) llvm-svn: 256665
* [MS ABI] Remove mangleCXXCatchHandlerTypeDavid Majnemer2015-12-312-14/+0
| | | | | | It's dead code, no functional change is intended. llvm-svn: 256664
* [MS ABI] Change the ArgBackRefMap to hold const qualified pointersDavid Majnemer2015-12-311-2/+2
| | | | | | Just a cleanup, no functional change is intended. llvm-svn: 256663
* [MS ABI] Replace dead code with an assertionDavid Majnemer2015-12-311-2/+4
| | | | | | | As per C++ [dcl.ref]p1, cv-qualified references are not valid. As such, change the mangler to assert that this event does not happen. llvm-svn: 256662
* [MSVC Compat] Diagnose multiple default ctors for dllexport'd classesDavid Majnemer2015-12-313-2/+31
| | | | | | | | | | | | | | | | | The MS ABI emits a special default constructor closure thunk if a default constructor has a weird calling convention or default arguments. The MS ABI has a quirk: there can be only one such thunk because the mangling scheme does not have room for distinct manglings. We must raise a diagnostic in this eventuality. N.B. MSVC sorta gets this right. Multiple default constructors result in the default constructor closure getting emitted but they seem to get confused by which default constructors are reasonable to reference from the closure. We try to be a little more careful which results in mild differences in behavior. llvm-svn: 256661
* [TrailingObjects] Convert classes in ExprObjC.hJames Y Knight2015-12-314-122/+99
| | | | llvm-svn: 256659
* [TrailingObjects] Convert remaining classes in Expr.h and ExprCXX.hJames Y Knight2015-12-315-199/+153
| | | | llvm-svn: 256658
* Improve diagnostic for the case where a function template candidate is rejectedRichard Smith2015-12-318-16/+95
| | | | | | | | by overload resolution because deduction succeeds, but the substituted parameter type for some parameter (with deduced type) doesn't exactly match the corresponding adjusted argument type. llvm-svn: 256657
* Implement [temp.deduct.type]p6: if the nested-name-specifier of a type isRichard Smith2015-12-303-11/+26
| | | | | | dependent, the type is a non-deduced context. llvm-svn: 256651
* Silencing a -Wcast-qual warning; NFC.Aaron Ballman2015-12-301-1/+1
| | | | llvm-svn: 256644
* When performing an implicit from float to bool, the floating point value ↵Aaron Ballman2015-12-302-1/+12
| | | | | | | | must be *exactly* zero in order for the conversion to result in 0. This does not involve a conversion through an integer value, and so truncation of the value is not performed. This patch address PR25876. llvm-svn: 256643
* Disable generating movt on FreeBSD.Davide Italiano2015-12-302-2/+7
| | | | | | | | | | It's sort of an hack, but we have no choice. The linker in the base system doesn't handle that correctly (yet). Once FreeBSD will import lld, this can be backed out. Patch by: Andrew Turner! llvm-svn: 256641
* clang-format: Slightly row back on r256343 by increasing penalty forDaniel Jasper2015-12-302-1/+5
| | | | | | | | | | | | | breaking between array subscripts. Before: if (aaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaa] [aaaaaaaaaaaaa]) After: if (aaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaa[aaaaaaaaaaaaa][aaaaaaaaaaaaa]) llvm-svn: 256640
* [OPENMP 4.5] Allow 'ordered' clause on 'loop simd' constructs.Alexey Bataev2015-12-3010-12/+61
| | | | | | OpenMP 4.5 allows to use 'ordered' clause without parameter on 'loop simd' constructs. llvm-svn: 256639
OpenPOWER on IntegriCloud