summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Don't pass FPOpFusion::Strict to the backendAdam Nemet2017-04-201-0/+18
| | | | | | | | | | | | | | | This restores the behavior prior to D31167 where the code-gen default was FPC_On which mapped to FPOpFusion::Standard. After merging the FE state (on/off) and the code-gen state (on/fast/off), the default became off to match the front-end. In other words, the front-end controls when to fuse along the language standards and the backend shouldn't override this by splitting fused intrinsics as FPOpFusion::Strict would imply. Differential Revision: https://reviews.llvm.org/D32301 llvm-svn: 300858
* Parse backend options during thinlto backend compile actionsDavid Blaikie2017-04-191-0/+13
| | | | llvm-svn: 300741
* Debug Info: Remove special-casing of indirect function argument handling.Adrian Prantl2017-04-181-2/+2
| | | | | | | | | | | | LLVM has changed the semantics of dbg.declare for describing function arguments. After this patch a dbg.declare always takes the *address* of a variable as the first argument, even if the argument is not an alloca. https://bugs.llvm.org/show_bug.cgi?id=32382 rdar://problem/31205000 llvm-svn: 300523
* [X86][SSE] Update MOVNTDQA non-temporal loads to generic implementation (clang)Simon Pilgrim2017-04-143-3/+3
| | | | | | | | | | MOVNTDQA non-temporal aligned vector loads can be correctly represented using generic builtin loads, allowing us to remove the existing x86 intrinsics. LLVM companion patch: D31767. Differential Revision: https://reviews.llvm.org/D31766 llvm-svn: 300326
* [OpenCL] Map default address space to alloca address spaceYaxun Liu2017-04-112-3/+68
| | | | | | | | | | | | | | For OpenCL, the private address space qualifier is 0 in AST. Before this change, 0 address space qualifier is always mapped to target address space 0. As now target private address space is specified by alloca address space in data layout, address space qualifier 0 needs to be mapped to alloca addr space specified by the data layout. This change has no impact on targets whose alloca addr space is 0. With contributions from Matt Arsenault, Tony Tye and Wen-Heng (Jack) Chung Differential Revision: https://reviews.llvm.org/D31404 llvm-svn: 299965
* Reland "[IR] Make AttributeSetNode public, avoid temporary AttributeList copies"Reid Kleckner2017-04-101-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | This re-lands r299875. I introduced a bug in Clang code responsible for replacing K&R, no prototype declarations with a real function definition with a prototype. The bug was here: // Collect any return attributes from the call. - if (oldAttrs.hasAttributes(llvm::AttributeList::ReturnIndex)) - newAttrs.push_back(llvm::AttributeList::get(newFn->getContext(), - oldAttrs.getRetAttributes())); + newAttrs.push_back(oldAttrs.getRetAttributes()); Previously getRetAttributes() carried AttributeList::ReturnIndex in its AttributeList. Now that we return the AttributeSetNode* directly, it no longer carries that index, and we call this overload with a single node: AttributeList::get(LLVMContext&, ArrayRef<AttributeSetNode*>) That aborted with an assertion on x86_32 targets. I added an explicit triple to the test and added CHECKs to help find issues like this in the future sooner. llvm-svn: 299899
* Update for lifetime intrinsic signature changeMatt Arsenault2017-04-105-50/+50
| | | | llvm-svn: 299877
* [cfi] Emit __cfi_check stub in the frontend.Evgeniy Stepanov2017-04-071-0/+5
| | | | | | | | | Previously __cfi_check was created in LTO optimization pipeline, which means LLD has no way of knowing about the existence of this symbol without rescanning the LTO output object. As a result, LLD fails to export __cfi_check, even when given --export-dynamic-symbol flag. llvm-svn: 299806
* Attempt to fix ms-intrinsics.c testHans Wennborg2017-04-071-6/+6
| | | | llvm-svn: 299785
* Implement _interlockedbittestandset as a builtinHans Wennborg2017-04-071-0/+11
| | | | | | | | | It's used by MS headers in VS 2017 without including intrin.h, so we can't implement it in the header anymore. Differential Revision: https://reviews.llvm.org/D31736 llvm-svn: 299782
* Add #pragma clang fpAdam Nemet2017-04-042-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | This adds the new pragma and the first variant, contract(on/off/fast). The pragma has the same block scope rules as STDC FP_CONTRACT, i.e. it can be placed at the beginning of a compound statement or at file scope. Similarly to STDC FP_CONTRACT there is no need to use attributes. First an annotate token is inserted with the parsed details of the pragma. Then the annotate token is parsed in the proper contexts and the Sema is updated with the corresponding FPOptions using the shared ActOn function with STDC FP_CONTRACT. After this the FPOptions from the Sema is propagated into the AST expression nodes. There is no change here. I was going to add a 'default' option besides 'on/off/fast' similar to STDC FP_CONTRACT but then decided against it. I think that we'd have to make option uppercase then to avoid using 'default' the keyword. Also because of the scoped activation of pragma I am not sure there is really a need a for this. Differential Revision: https://reviews.llvm.org/D31276 llvm-svn: 299470
* Set FMF for -ffp-contract=fastAdam Nemet2017-04-041-0/+29
| | | | | | | | | | | | | | With this, FMF(contract) becomes an alternative way to express the request to contract. These are currently only propagated for FMul, FAdd and FSub. The rest will be added as more FMFs are hooked up for this. This is toward fixing PR25721. Differential Revision: https://reviews.llvm.org/D31168 llvm-svn: 299469
* [fixup][X86][inline-asm] Add support for MS 'EVEN' directiveCoby Tayree2017-04-041-1/+2
| | | | | | refining tested targets resolution, to amend failures caused by rL299454 llvm-svn: 299459
* [X86][inline-asm] Add support for MS 'EVEN' directiveCoby Tayree2017-04-041-0/+15
| | | | | | | | | | | | MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'. This patch include the (small, simple) changes need to allow it. llvm-side: https://reviews.llvm.org/D27417 Differential Revision: https://reviews.llvm.org/D27418 llvm-svn: 299454
* Fix problem with test. Michael Zuckerman2017-04-044-24/+24
| | | | llvm-svn: 299442
* [X86][Clang] Converting __mm{|256|512}_movm_epi{8|16|32|64} LLVMIR call into ↵Michael Zuckerman2017-04-044-12/+27
| | | | | | | | | | | | generic intrinsics. This patch is a part two of two reviews, one for the clang and the other for LLVM. In this patch, I covered the clang side, by introducing the intrinsic to the front end. This is done by creating a generic replacement. Differential Revision: https://reviews.llvm.org/D31394a llvm-svn: 299431
* [ThinLTO] Handle -emit-llvm* in ThinLTO backendsTeresa Johnson2017-03-311-0/+10
| | | | | | | | | | | | | | Summary: Use PreCodeGenModuleHook to invoke the correct writer when emitting LLVM IR, returning false to skip codegen from within thinBackend. Reviewers: pcc, mehdi_amini Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D31534 llvm-svn: 299274
* [Sema][X86] Update immediate check for gather/scatter prefetch instructions ↵Craig Topper2017-03-311-16/+16
| | | | | | | | | | to match the _MM_HINT_T0/T1 constant definitions Our _MM_HINT_T0/T1 constant values are 3/2 which matches gcc, but not icc or Intel documentation. Interestingly gcc had this same bug on their implementation of the gather/scatter builtins at one point too. Fixes PR32411. llvm-svn: 299233
* [mips][msa] Range adjustment for ldi_b builtin function operandPetar Jovanovic2017-03-312-2/+4
| | | | | | | | | | | | | | | Reasoning behind this change was allowing the function to accept all values from range [-128, 255] since all of them can be encoded in an 8bit wide value. This differs from the prior state where only range [-128, 127] was accepted, where values were assumed to be signed, whereas now the actual interpretation of the immediate is deferred to the consumer as required. Patch by Stefan Maksimovic. Differential Revision: https://reviews.llvm.org/D31082 llvm-svn: 299229
* Add back test for r299152Teresa Johnson2017-03-311-0/+6
| | | | | | | I am hoping the bot failures are addressed by using cc1 for the ThinLTO backend invocations as well. llvm-svn: 299217
* Revert test added in r299152Teresa Johnson2017-03-311-6/+0
| | | | | | | Removing the test until I can figure out how to get the ThinLTO backend invocation of clang to use the correct target. llvm-svn: 299181
* Add target-cpuTeresa Johnson2017-03-311-2/+2
| | | | | | | | Sigh, another follow-on fix needed for test in r299152 causing bot failures. We also need the target-cpu for the ThinLTO BE clang invocation. llvm-svn: 299178
* Add more target triples to testTeresa Johnson2017-03-311-2/+2
| | | | | | | | Third and hopefully final fix to test for r299152 that is causing bot failures: make sure the target triple specified for the ThinLTO backend clang invocations as well. llvm-svn: 299176
* Fix new compile command in testTeresa Johnson2017-03-311-1/+1
| | | | | | | My previous attempt to fix bot failures from r299152 didn't add the necessary option to get bitcode out of the cc1 step. llvm-svn: 299173
* Add triple to new testTeresa Johnson2017-03-311-1/+1
| | | | | | | Attempt to fix bot errors from r299152 by using clang_cc1 and specifying target triple to compile step. llvm-svn: 299170
* [ThinLTO] Set up lto::Config properly for codegen in ThinLTO backendsTeresa Johnson2017-03-311-1/+7
| | | | | | | | | | | | | | | | Summary: This involved refactoring out pieces of EmitAssemblyHelper::CreateTargetMachine for use in runThinLTOBackend. Subsumes D31114. Reviewers: mehdi_amini, pcc Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D31508 llvm-svn: 299152
* fixup: use CHECK for non-atttribute setsDean Michael Berris2017-03-301-2/+2
| | | | llvm-svn: 299127
* [XRay][clang] Fix the -fxray-instruction-threshold flag processingDean Michael Berris2017-03-301-0/+14
| | | | | | | | | | | | | | | Summary: The refactoring introduced a regression in the flag processing for -fxray-instruction-threshold which causes it to not get passed properly. This change should restore the previous behaviour. Reviewers: rnk, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31491 llvm-svn: 299126
* Clang changes for alloc_align attribute Erich Keane2017-03-301-0/+101
| | | | | | | | GCC has the alloc_align attribute, which is similar to assume_aligned, except the attribute's parameter is the index of the integer parameter that needs aligning to. Differential Revision: https://reviews.llvm.org/D29599 llvm-svn: 299117
* [XRay] Add -fxray-{always,never}-instrument= flags to clangDean Michael Berris2017-03-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | Summary: The -fxray-always-instrument= and -fxray-never-instrument= flags take filenames that are used to imbue the XRay instrumentation attributes using a whitelist mechanism (similar to the sanitizer special cases list). We use the same syntax and semantics as the sanitizer blacklists files in the implementation. As implemented, we respect the attributes that are already defined in the source file (i.e. those that have the [[clang::xray_{always,never}_instrument]] attributes) before applying the always/never instrument lists. Reviewers: rsmith, chandlerc Subscribers: jfb, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D30388 llvm-svn: 299041
* Revert r298491 and r298494 which changed Clang's handling of 'nonnull'Chandler Carruth2017-03-242-98/+0
| | | | | | | | | | | | | | | | | attributes. These patches don't work because we can't currently access the parameter information in a reliable way when building attributes. I thought this would be relatively straightforward to fix, but it seems not to be the case. Fixing this will requrie a substantial re-plumbing of machinery to allow attributes to be handled in this location, and several other fixes to the attribute machinery should probably be made at the same time. All of this will make the patch .... substantially more complicated. Reverting for now as there are active miscompiles caused by the current version. llvm-svn: 298695
* Update the SamplePGO test to verify that unroll/icp is not invoked in ↵Dehao Chen2017-03-232-4/+29
| | | | | | | | | | | | | | | | thinlto compile phase. Summary: This is the test added for https://reviews.llvm.org/D31217 Reviewers: tejohnson, mehdi_amini Reviewed By: tejohnson Subscribers: cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31219 llvm-svn: 298647
* [ThinLTO] Clang support for emitting minimized bitcode for thin linkTeresa Johnson2017-03-231-0/+9
| | | | | | | | | | | | | | | | | Summary: Clang companion patch to LLVM patch D31027, which adds support for emitting minimized bitcode file for use in the thin link step. Add a cc1 option -fthin-link-bitcode=<file> to trigger this behavior. Depends on D31027. Reviewers: mehdi_amini, pcc Subscribers: cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31050 llvm-svn: 298639
* [X86] Implement __readgsqword (and the rest) as builtins (PR32373)Hans Wennborg2017-03-221-3/+62
| | | | | | | | | | | | | | It seems MS headers have started using __readgsqword, and since it's used in a header that doesn't include intrin.h, we can't implement it as an inline function anymore. That was already the case for __readfsdword, which Saleem added support for in r220859. This patch reuses that codegen to implement all of __read[fg]s{byte,word,dword,qword}. Differential Revision: https://reviews.llvm.org/D31248 llvm-svn: 298538
* [X86][MMX] Add tests for _mm_set*_* intrinsicsSimon Pilgrim2017-03-221-0/+87
| | | | llvm-svn: 298511
* Remove an overly aggressive assert in r298491 and leave a commentChandler Carruth2017-03-221-0/+14
| | | | | | | | | | explaining why we have to ignore errors here even though in other parts of codegen we can be more strict with builtins. Also add a test case based on the code in a TSan test that found this issue. llvm-svn: 298494
* [nonnull] Teach Clang to attach the nonnull LLVM attribute toChandler Carruth2017-03-221-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | declarations and calls instead of just definitions, and then teach it to *not* attach such attributes even if the source code contains them. This follows the design direction discussed on cfe-dev here: http://lists.llvm.org/pipermail/cfe-dev/2017-January/052066.html The idea is that for C standard library builtins, even if the library vendor chooses to annotate their routines with __attribute__((nonnull)), we will ignore those attributes which pertain to pointer arguments that have an associated size. This allows the widespread (and seemingly reasonable) pattern of calling these routines with a null pointer and a zero size. I have only done this for the library builtins currently recognized by Clang, but we can now trivially add to this set. This will be controllable with -fno-builtin if anyone should care to do so. Note that this does *not* change the AST. As a consequence, warnings, static analysis, and source code rewriting are not impacted. This isn't even a regression on any platform as neither Clang nor LLVM have ever put 'nonnull' onto these arguments for declarations. All this patch does is enable it on other declarations while preventing us from ever accidentally enabling it on these libc functions due to a library vendor. It will also allow any other libraries using this annotation to gain optimizations based on the annotation even when only a declaration is visible. llvm-svn: 298491
* Remove -ffp-contract=fast from this testAdam Nemet2017-03-221-1/+1
| | | | | | | It does not need it and causes mismatch after -ffp-contract=fast is turned into an FMF. llvm-svn: 298469
* Change -ffp-contract=fast test to run on Aarch64Adam Nemet2017-03-221-3/+3
| | | | | | | (I don't have powerpc enabled in my build and I am changing how -ffp-contract=fast works.) llvm-svn: 298468
* Remove the -faltivec alias option and replace it with -maltivec everywhere.Eric Christopher2017-03-2113-25/+25
| | | | | | | | | | | The alias was only ever used on darwin and had some issues there, and isn't used in practice much. Also fixes a problem with -mno-altivec not turning off -maltivec. Also add a diagnostic for faltivec/fno-altivec that directs users to use maltivec options and include the altivec.h file explicitly. llvm-svn: 298449
* Let llvm.objectsize be conservative with null pointersGeorge Burgess IV2017-03-215-65/+65
| | | | | | | D28494 adds another parameter to @llvm.objectsize. Clang needs to be sure to pass that third arg whenever applicable. llvm-svn: 298431
* Clang change: Do not inline hot callsites for samplepgo in thinlto compile ↵Dehao Chen2017-03-212-0/+21
| | | | | | | | | | | | | | | | | | phase. Summary: Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro file, thus we do not want to inline hot callsites in the first phase. Reviewers: tejohnson, eraman Reviewed By: tejohnson Subscribers: mehdi_amini, cfe-commits, Prazek Differential Revision: https://reviews.llvm.org/D31202 llvm-svn: 298429
* [X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part ↵Coby Tayree2017-03-211-0/+7
| | | | | | | | | | | | | | | of a compound expression This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions. Currently - only supported as a stand alone Operand, e.g.: "TYPE X" now allowed : "4 + TYPE X * 128" LLVM side: https://reviews.llvm.org/D31173 Differential Revision: https://reviews.llvm.org/D31174 llvm-svn: 298426
* [X86][AVX512] Add _mm512_cvtsd_f64 and _mm512_cvtss_f32 intrinsics (PR32305)Simon Pilgrim2017-03-211-0/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D31155 llvm-svn: 298364
* [X86][AVX512][Clang][Intrinsics] Adding missing intrinsics to Clang .Igor Breger2017-03-191-0/+127
| | | | | | | | | | | | | | | | | | | Summary: Adding missing intrinsics : _mm512_set_epi16, _mm512_set_epi8, _mm512_permutevar_epi32 _mm512_mask_permutevar_epi32 Reviewers: zvi, guyblank, eladcohen, craig.topper Reviewed By: craig.topper Subscribers: craig.topper, cfe-commits Differential Revision: https://reviews.llvm.org/D31034 llvm-svn: 298208
* [X86] Add NumRegisterParameters Module Flag.Nirav Dave2017-03-181-0/+13
| | | | | | | | | | Reviewers: rnk, mkuper Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D27051 llvm-svn: 298177
* [AVX-512] Fix test cases that were using the builtins directly without ↵Craig Topper2017-03-171-3/+3
| | | | | | typecasts instead of the intrinsic header. llvm-svn: 298041
* [X86][XOP] Add codegen tests for vector integer comparison intrinsics (PR15844)Simon Pilgrim2017-03-151-0/+405
| | | | | | We were testing for the generic _mm_com_* intrinsics, but not the specific comparison mode versions. llvm-svn: 297885
* [x86] these aren't the undefs you're looking for (PR32176)Sanjay Patel2017-03-129-109/+109
| | | | | | | | | | | | | x86 has undef SSE/AVX intrinsics that should represent a bogus register operand. This is not the same as LLVM's undef value which can take on multiple bit patterns. There are better solutions / follow-ups to this discussed here: https://bugs.llvm.org/show_bug.cgi?id=32176 ...but this should prevent miscompiles with a one-line code change. Differential Revision: https://reviews.llvm.org/D30834 llvm-svn: 297588
* [mips][msa] Remove range checks for non-immediate sld.[bhwd] instructionsPetar Jovanovic2017-03-102-10/+5
| | | | | | | | | | | Removes immediate range checks for these instructions, since they have GPR rt as their input operand. Patch by Stefan Maksimovic. Differential Revision: https://reviews.llvm.org/D30693 llvm-svn: 297485
OpenPOWER on IntegriCloud