summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenCL] Clean up and add missing fields for block structYaxun Liu2017-10-041-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently block is translated to a structure equivalent to struct Block { void *isa; int flags; int reserved; void *invoke; void *descriptor; }; Except invoke, which is the pointer to the block invoke function, all other fields are useless for OpenCL, which clutter the IR and also waste memory since the block struct is passed to the block invoke function as argument. On the other hand, the size and alignment of the block struct is not stored in the struct, which causes difficulty to implement __enqueue_kernel as library function, since the library function needs to know the size and alignment of the argument which needs to be passed to the kernel. This patch removes the useless fields from the block struct and adds size and align fields. The equivalent block struct will become struct Block { int size; int align; generic void *invoke; /* custom fields */ }; It also changes the pointer to the invoke function to be a generic pointer since the address space of a function may not be private on certain targets. Differential Revision: https://reviews.llvm.org/D37822 llvm-svn: 314932
* [ubsan] Save a ptrtoint when emitting alignment checksVedant Kumar2017-10-031-2/+1
| | | | | | | The alignment check emits a ptrtoint instruction which can be reused in the call to the diagnostic handler. llvm-svn: 314749
* Add a testcase to check that debug info is upgraded when compiling LLVM IRAdrian Prantl2017-10-021-0/+17
| | | | | | through clang. llvm-svn: 314700
* [X86][MS-InlineAsm] Extended support for variables / identifiers on memory / ↵Coby Tayree2017-09-292-0/+90
| | | | | | | | | | | immediate expressions Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized. supersedes D33278, D35774 Differential Revision: https://reviews.llvm.org/D37413 llvm-svn: 314494
* revert rL314300Coby Tayree2017-09-272-89/+0
| | | | | | accidently added only tests w/o the respective changes.. llvm-svn: 314302
* [X86][MS-InlineAsm] Extended support for variables / identifiers on memory / ↵Coby Tayree2017-09-272-0/+89
| | | | | | | | | | immediate expressions Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized. supersedes D33277, D35775 Corrsponds with D37412, D37413 llvm-svn: 314300
* Basic: support Preserve{Most,All} CC on WindowsSaleem Abdulrasool2017-09-261-0/+3
| | | | | | | Add support for the `preserve_mostcc` and `preserve_allcc` on Windows x86_64 and AArch64. This is used by Swift. llvm-svn: 314236
* [NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.Artem Belevich2017-09-261-1/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D38191 llvm-svn: 314223
* Fix TBAA information for reference accessesIvan A. Kosarev2017-09-261-0/+29
| | | | | | | | | This patch fixes clang to decorate reference accesses as pointers and not as "omnipotent chars". Differential Revision: https://reviews.llvm.org/D38074 llvm-svn: 314209
* Allow specifying sanitizers in blacklistsVlad Tsyrklevich2017-09-256-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the follow-up patch to D37924. This change refactors clang to use the the newly added section headers in SpecialCaseList to specify which sanitizers blacklists entries should apply to, like so: [cfi-vcall] fun:*bad_vcall* [cfi-derived-cast|cfi-unrelated-cast] fun:*bad_cast* The SanitizerSpecialCaseList class has been added to allow querying by SanitizerMask, and SanitizerBlacklist and its downstream users have been updated to provide that information. Old blacklists not using sections will continue to function identically since the blacklist entries will be placed into a '[*]' section by default matching against all sanitizers. Reviewers: pcc, kcc, eugenis, vsk Reviewed By: eugenis Subscribers: dberris, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D37925 llvm-svn: 314171
* [x86] make assertions less strict in avx512f test fileSanjay Patel2017-09-251-1/+1
| | | | | | Missed a line in r314158. llvm-svn: 314159
* [x86] make assertions less strict in avx512f test fileSanjay Patel2017-09-251-16/+16
| | | | | | I'm not sure why yet, but there may be differences depending on the host? llvm-svn: 314158
* [x86] remove RUNs that were checking fully optimized IRSanjay Patel2017-09-252-421/+2546
| | | | | | | | Clang regression tests that depend on the optimizer can break when there are changes to LLVM...as in: https://reviews.llvm.org/rL314117 llvm-svn: 314144
* Revert "[NVPTX] added match.{any,all}.sync instructions, intrinsics & ↵Justin Lebar2017-09-251-21/+1
| | | | | | | | | | | | | | | builtins.", rL314135. Causing assertion failures on macos: > Assertion failed: (Num < NumOperands && "Invalid child # of SDNode!"), > function getOperand, file > /Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-incremental/llvm/include/llvm/CodeGen/SelectionDAGNodes.h, > line 835. http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental/42739/testReport/LLVM/CodeGen_NVPTX/surf_read_cuda_ll/ llvm-svn: 314142
* [NVPTX] added match.{any,all}.sync instructions, intrinsics & builtins.Artem Belevich2017-09-251-1/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D38191 llvm-svn: 314135
* fixing a bug in mask[z]_set1 intrinsicJina Nahias2017-09-251-32/+4
| | | | | | | Differential Revision: https://reviews.llvm.org/D38231 Change-Id: I80bbff9cbe93e4be54d8a761ef9723edf3f57c57 llvm-svn: 314102
* Promote storage-only __fp16 vector operands to float vectors.Akira Hatanaka2017-09-231-0/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug in the handling of storage-only __fp16 vectors where clang didn't promote __fp16 vector operands to float vectors. Conceptually, it performs the following transformation on the AST in CreateBuiltinBinOp and CreateBuiltinUnaryOp: (Before) typedef __fp16 half4 __attribute__ ((vector_size (8))); typedef float float4 __attribute__ ((vector_size (16))); half4 hv0, hv1, hv2, hv3; hv0 = hv1 + hv2 + hv3; (After) float4 t0 = (float4)hv1 + (float4)hv2; float4 t1 = t0 + (float4)hv3; hv0 = (half4)t1; Note that this commit fixes the bug for targets that set HalfArgsAndReturns to true (ARM and ARM64). Targets using intrinsics such as llvm.convert.to.fp16 to handle __fp16 are still broken. rdar://problem/20625184 Differential Revision: https://reviews.llvm.org/D32520 llvm-svn: 314056
* [CodeGen][ObjC] Build the global block structure before emitting theAkira Hatanaka2017-09-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | body of global block invoke functions. This commit fixes an infinite loop in IRGen that occurs when compiling the following code: void FUNC2() { static void (^const block1)(int) = ^(int a){ if (a--) block1(a); }; } This is how IRGen gets stuck in the infinite loop: 1. GenerateBlockFunction is called to emit the body of "block1". 2. GetAddrOfGlobalBlock is called to get the address of "block1". The function calls getAddrOfGlobalBlockIfEmitted to check whether the global block has been emitted. If it hasn't been emitted, it then tries to emit the body of the block function by calling GenerateBlockFunction, which goes back to step 1. This commit prevents the inifinite loop by building the global block in GenerateBlockFunction before emitting the body of the block function. rdar://problem/34541684 Differential Revision: https://reviews.llvm.org/D38118 llvm-svn: 314029
* [NVPTX] Implemented bar.warp.sync, barrier.sync, and vote{.sync} ↵Artem Belevich2017-09-212-2/+51
| | | | | | | | instructions/intrinsics/builtins. Differential Revision: https://reviews.llvm.org/D38148 llvm-svn: 313898
* [NVPTX] Implemented shfl.sync instruction and supporting intrinsics/builtins.Artem Belevich2017-09-202-0/+61
| | | | | | Differential Revision: https://reviews.llvm.org/D38090 llvm-svn: 313820
* Remove offset size check in nullptr arithmetic handlingAndrew Kaylor2017-09-201-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D37042 llvm-svn: 313784
* Fix 32-bit buildbots by removing tests that are dependent on pointer-size ↵Andrew Kaylor2017-09-191-12/+4
| | | | | | | | comparisons. The recently behavior in the code that these tests were meant to be checking will be ammended as soon as a suitable change can be properly reviewed. llvm-svn: 313684
* Teach clang to tolerate the 'p = nullptr + n' idiom used by glibcAndrew Kaylor2017-09-191-0/+42
| | | | | | Differential Revision: https://reviews.llvm.org/D37042 llvm-svn: 313666
* Lowering Mask Set1 intrinsics to LLVM IRJina Nahias2017-09-194-70/+554
| | | | | | | | This patch, together with a matching llvm patch (https://reviews.llvm.org/D37669), implements the lowering of X86 mask set1 intrinsics to IR. Differential Revision: https://reviews.llvm.org/D37668 llvm-svn: 313624
* [WebAssembly] Restore __builtin_wasm_rethrow builtinHeejin Ahn2017-09-161-0/+6
| | | | | | | | | | | | | | | | Summary: Restore the `__builtin_wasm_rethrow` builtin deleted in D37931. On second thought, it appears it can be used to implement `__cxa_rethrow`. Reviewers: dschuff, sunfish Reviewed By: dschuff Subscribers: jfb, sbc100, jgravelle-google Differential Revision: https://reviews.llvm.org/D37942 llvm-svn: 313430
* [X86] Use native shuffle vector for the perm2f128 intrinsicsCraig Topper2017-09-152-5/+5
| | | | | | | | | | This patch replaces the perm2f128 intrinsics with native shuffle vectors. This uses a pretty simple approach to allocate source 0 to the lower half input and source 1 to the upper half input. Then its just a matter of filling in the indices to use either the lower or upper half of that specific source. This can result in the same source being used by both operands. InstCombine or SelectionDAGBuilder should be able to clean that up. Differential Revision: https://reviews.llvm.org/D37892 llvm-svn: 313418
* Remove __builtin_wasm_rethrow builtinHeejin Ahn2017-09-151-6/+0
| | | | | | | | | | | | | | | | | Summary: Remove `__builtin_wasm_rethrow` builtin. I thought it was required to implement `__cxa_rethrow` function in libcxxabi, but it turned out it will be using `__builtin_wasm_throw` instead. Reviewers: dschuff, jgravelle-google Reviewed By: jgravelle-google Subscribers: jfb, sbc100, jgravelle-google Differential Revision: https://reviews.llvm.org/D37931 llvm-svn: 313402
* [X86] Disable _mm512_maskz_set1_epi64 intrinsic on 32-bit targets to prevent ↵Craig Topper2017-09-151-0/+7
| | | | | | | | | | | | a backend isel failure. The __builtin_ia32_pbroadcastq512_mem_mask we were previously trying to use in 32-bit mode is not implemented in the x86 backend and causes isel to fail in release builds. In debug builds it fails even earlier during legalization with an llvm_unreachable. While there add the missing test case for this intrinsic for this for 64-bit mode. This fixes PR34631. D37668 should be able to recover this for 32-bit mode soon. But I wanted to fix the crash ahead of that. llvm-svn: 313392
* [X86] [PATCH] [intrinsics] Lowering X86 ABS intrinsics to IR. (clang)Uriel Korach2017-09-136-46/+128
| | | | | | | | This patch, together with a matching llvm patch (https://reviews.llvm.org/D37693), implements the lowering of X86 ABS intrinsics to IR. Differential Revision: https://reviews.llvm.org/D37694 llvm-svn: 313133
* Fix PR34021 test on non-x86 build targetsSimon Pilgrim2017-09-121-12/+12
| | | | llvm-svn: 313034
* Limit test to x86 targetsSimon Pilgrim2017-09-121-0/+1
| | | | llvm-svn: 313024
* [MS-InlineAsm] Fix cast assertion with vector spills (PR34021)Simon Pilgrim2017-09-121-0/+24
| | | | | | Differential Revision: https://reviews.llvm.org/D37448 llvm-svn: 313019
* [X86] Lower _mm[256|512]_[mask[z]]_avg_epu[8|16] intrinsics to native llvm IRYael Tsafrir2017-09-125-22/+136
| | | | | | Differential Revision: https://reviews.llvm.org/D37562 llvm-svn: 313011
* Fixing incorrectly capitalised regexps.Benjamin Kramer2017-09-072-90/+90
| | | | | | Patch by Sam Allen! llvm-svn: 312710
* Corrected testcase to work with release buildKarl-Johan Karlsson2017-09-061-3/+3
| | | | | | The fault was introduced in r312623 llvm-svn: 312627
* Debug info: Fixed faulty debug locations for attributed statementsKarl-Johan Karlsson2017-09-061-0/+12
| | | | | | | | | | | | | | | | | Summary: As the attributed statements are considered simple statements no stoppoint was generated before emitting attributed do/while/for/range- statement. This lead to faulty debug locations. Reviewers: echristo, aaron.ballman, dblaikie Reviewed By: dblaikie Subscribers: bjope, aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D37428 llvm-svn: 312623
* Commit changes missing from r312572Reid Kleckner2017-09-051-5/+5
| | | | llvm-svn: 312573
* [ms] Implement the __annotation intrinsicReid Kleckner2017-09-051-0/+26
| | | | llvm-svn: 312572
* [X86][AVX512] _mm512_stream_load_si512 should take a void const* argument ↵Simon Pilgrim2017-09-051-0/+6
| | | | | | | | | | | | (PR33977) Based off the Intel Intrinsics guide, we should expect a void const* argument. Prevents 'passing 'const void *' to parameter of type 'void *' discards qualifiers' warnings. Differential Revision: https://reviews.llvm.org/D37449 llvm-svn: 312523
* [CodeGen] Treat all vector fields as mayaliasHal Finkel2017-09-031-0/+20
| | | | | | | | | | | | | | | Because it is common to treat vector types as an array of their elements, or even some other type that's not the element type, and thus index into them, we can't use struct-path TBAA for these accesses. Even though we already treat all vector types as equivalent to 'char', we were using field-offset information for them with TBAA, and this renders undefined the intra-value indexing we intend to allow. Note that, although 'char' is universally aliasing, with path TBAA, we can still differentiate between access to s.a and s.b in struct { char a, b; } s;. We can't use this capability as-is for vector types. Fixes PR33967. llvm-svn: 312447
* Fix the test fix from r312181Hans Wennborg2017-08-302-3/+3
| | | | llvm-svn: 312193
* Fix tests for ARM targetsDouglas Yung2017-08-302-2/+2
| | | | | | | | | | Tests fail on ARM targets due to ABI name between define and void. Added reg ex to skip. Patch by Glenn Howe (and expanded on by Douglas Yung)! Differential Revision: https://reviews.llvm.org/D33410 llvm-svn: 312181
* [CodeGen][x86_64] Enable 'force_align_arg_pointer' attribute at x86_64Erich Keane2017-08-301-0/+1
| | | | | | | | | | | | | This attribute is useful in OS development when we jump from 32 to 64 bit code and expect that 64bit function forces correct stack alignment. Related discussion: http://lists.llvm.org/pipermail/cfe-dev/2017-June/054358.html Patch By: anatol.pomozov (anatol.pomozov@gmail.com) Differential Revision:https://reviews.llvm.org/D36272 llvm-svn: 312173
* Adapt testcases to LLVM change r312144 in DIGlobalVariableExpressionAdrian Prantl2017-08-303-4/+4
| | | | llvm-svn: 312148
* [X86] Implement broadcastf32x2 and broadcasti32x2 intrinsics using ↵Craig Topper2017-08-302-15/+25
| | | | | | | | | | __builtin_shufflevector instead builtins This patch implements the broadcastf32x2/broadcasti32x2 intrinsics using __builtin_shufflevector. Differential Revision: https://reviews.llvm.org/D37287 llvm-svn: 312135
* Minimal runtime for UBSan.Evgeniy Stepanov2017-08-291-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: An implementation of ubsan runtime library suitable for use in production. Minimal attack surface. * No stack traces. * Definitely no C++ demangling. * No UBSAN_OPTIONS=log_file=/path (very suid-unfriendly). And no UBSAN_OPTIONS in general. * as simple as possible Minimal CPU and RAM overhead. * Source locations unnecessary in the presence of (split) debug info. * Values and types (as in A+B overflows T) can be reconstructed from register/stack dumps, once you know what type of error you are looking at. * above two items save 3% binary size. When UBSan is used with -ftrap-function=abort, sometimes it is hard to reason about failures. This library replaces abort with a slightly more informative message without much extra overhead. Since ubsan interface in not stable, this code must reside in compiler-rt. Reviewers: pcc, kcc Subscribers: srhines, mgorny, aprantl, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D36810 llvm-svn: 312029
* [X86] Add support for __builtin_cpu_initCraig Topper2017-08-281-0/+4
| | | | | | | | | | This adds builtin_cpu_init which will emit a call to cpu_indicator_init in libgcc or compiler-rt. This is needed to support builtin_cpu_supports/builtin_cpu_is in an ifunc resolver. Differential Revision: https://reviews.llvm.org/D36336 llvm-svn: 311874
* Expose -mllvm -accurate-sample-profile to clang.Dehao Chen2017-08-241-0/+7
| | | | | | | | | | | | | | Summary: With accurate sample profile, we can do more aggressive size optimization. For some size-critical application, this can reduce the text size by 20% Reviewers: davidxl, rsmith Reviewed By: davidxl, rsmith Subscribers: mehdi_amini, eraman, sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D37091 llvm-svn: 311707
* [Clang][x86][Inline Asm] support for GCC style inline asm - Y<x> constraintsCoby Tayree2017-08-241-0/+68
| | | | | | | | | | This patch is intended to enable the use of basic double letter constraints used in GCC extended inline asm {Yi Y2 Yz Y0 Ym Yt}. Supersedes D35205 llvm counterpart: D36369 Differential Revision: https://reviews.llvm.org/D36371 llvm-svn: 311643
* Fixups to FE tests affected by D36793Coby Tayree2017-08-244-68/+68
| | | | | | Differential Revision: https://reviews.llvm.org/D36794 llvm-svn: 311640
OpenPOWER on IntegriCloud