summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/TargetInfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [PowerPC] Fix calculating address of arguments on stack for variadic funcPetar Jovanovic2015-12-041-28/+34
| | | | | | | | | | | Fix calculating address of arguments larger than 32 bit on stack for variadic functions (rounding up address to alignment) on ppc32 architecture. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D14871 llvm-svn: 254670
* Fixed default label in fully covered switch warning that was introduced in ↵Daniel Sanders2015-11-271-1/+0
| | | | | | r254203. llvm-svn: 254208
* [mips] Interrupt attribute support.Daniel Sanders2015-11-271-0/+21
| | | | | | | | | | | | | | Summary: This patch adds support for the interrupt attribute for mips32r2+. Patch by Simon Dardis. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254205
* Revert r254203: [mips] Interrupt attribute support.Daniel Sanders2015-11-271-21/+0
| | | | | | I forgot to credit the author. llvm-svn: 254204
* [mips] Interrupt attribute support.Daniel Sanders2015-11-271-0/+21
| | | | | | | | | | | | Summary: This patch adds support for the interrupt attribute for mips32r2+. Reviewers: dsanders, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D10802 llvm-svn: 254203
* Remove some legacy mingw-w64 gcc struct infoMartell Malone2015-11-031-4/+0
| | | | | | | | As of gcc 4.7 mingw-w64 no longer emits 128-bit structs as i128 Differential Revision: http://reviews.llvm.org/D14179 llvm-svn: 251930
* Fix va_arg on watchOS.Tim Northover2015-11-021-0/+4
| | | | | | As in other contexts, alignments can go up to 16 bytes in a va_list. llvm-svn: 251821
* ARMv7k: implement ABI changes for watchOS from standard iOS.Tim Northover2015-10-301-8/+63
| | | | llvm-svn: 251710
* Fix the calling convention of Mingw64 long double valuesReid Kleckner2015-10-281-11/+22
| | | | | | | | | | GCC uses the x87DoubleExtended model for long doubles, and passes them indirectly by address through function calls. Also replace the existing mingw-long-double assembly emitting test with an IR-level test. llvm-svn: 251567
* Access the right triple field for IAMCU.Michael Kuperstein2015-10-271-2/+2
| | | | llvm-svn: 251396
* [X86] Mark inregs correctly for MCU psABIMichael Kuperstein2015-10-251-5/+18
| | | | | | | | | The MCU psABI calling convention is somewhat, but not quite, like -mregparm 3. In particular, the rules involving structs are different. Differential Revision: http://reviews.llvm.org/D13978 llvm-svn: 251224
* Roll-back r250822.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | Summary: It breaks the build for the ASTMatchers Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D13893 llvm-svn: 250827
* Apply modernize-use-default to clang.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: bkramer, klimek Subscribers: klimek, alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13890 llvm-svn: 250822
* Fix 'will be initialized after' warning.Manuel Klimek2015-10-191-2/+2
| | | | llvm-svn: 250691
* [X86] Enable soft float ABI for x86Michael Kuperstein2015-10-191-11/+16
| | | | | | | | | The Intel MCU psABI requires floating-point values to be passed in-reg. This makes the x86-32 ABI code respect "-mfloat-abi soft" and generate float inreg arguments. Differential Revision: http://reviews.llvm.org/D13554 llvm-svn: 250689
* Use saner variable names. NFC.Michael Kuperstein2015-10-191-15/+23
| | | | llvm-svn: 250687
* Make a bunch of static arrays const.Craig Topper2015-10-181-1/+1
| | | | llvm-svn: 250647
* [CodeGen] [CodeGen] Attach function attributes to functions created inAkira Hatanaka2015-10-081-8/+8
| | | | | | | | | | | | | | | | | | CGBlocks.cpp. This commit fixes a bug in clang's code-gen where it creates the following functions but doesn't attach function attributes to them: __copy_helper_block_ __destroy_helper_block_ __Block_byref_object_copy_ __Block_byref_object_dispose_ rdar://problem/20828324 Differential Revision: http://reviews.llvm.org/D13525 llvm-svn: 249735
* Support __builtin_ms_va_list.Charles Davis2015-09-171-0/+15
| | | | | | | | | | | | | | | | | | Summary: This change adds support for `__builtin_ms_va_list`, a GCC extension for variadic `ms_abi` functions. The existing `__builtin_va_list` support is inadequate for this because `va_list` is defined differently in the Win64 ABI vs. the System V/AMD64 ABI. Depends on D1622. Reviewers: rsmith, rnk, rjmccall CC: cfe-commits Differential Revision: http://reviews.llvm.org/D1623 llvm-svn: 247941
* [WebAssembly] Simplify code by avoiding duplicating the default behavior.Dan Gohman2015-09-141-1/+0
| | | | llvm-svn: 247623
* Compute and preserve alignment more faithfully in IR-generation.John McCall2015-09-081-732/+796
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce an Address type to bundle a pointer value with an alignment. Introduce APIs on CGBuilderTy to work with Address values. Change core APIs on CGF/CGM to traffic in Address where appropriate. Require alignments to be non-zero. Update a ton of code to compute and propagate alignment information. As part of this, I've promoted CGBuiltin's EmitPointerWithAlignment helper function to CGF and made use of it in a number of places in the expression emitter. The end result is that we should now be significantly more correct when performing operations on objects that are locally known to be under-aligned. Since alignment is not reliably tracked in the type system, there are inherent limits to this, but at least we are no longer confused by standard operations like derived-to-base conversions and array-to-pointer decay. I've also fixed a large number of bugs where we were applying the complete-object alignment to a pointer instead of the non-virtual alignment, although most of these were hidden by the very conservative approach we took with member alignment. Also, because IRGen now reliably asserts on zero alignments, we should no longer be subject to an absurd but frustrating recurring bug where an incomplete type would report a zero alignment and then we'd naively do a alignmentAtOffset on it and emit code using an alignment equal to the largest power-of-two factor of the offset. We should also now be emitting much more aggressive alignment attributes in the presence of over-alignment. In particular, field access now uses alignmentAtOffset instead of min. Several times in this patch, I had to change the existing code-generation pattern in order to more effectively use the Address APIs. For the most part, this seems to be a strict improvement, like doing pointer arithmetic with GEPs instead of ptrtoint. That said, I've tried very hard to not change semantics, but it is likely that I've failed in a few places, for which I apologize. ABIArgInfo now always carries the assumed alignment of indirect and indirect byval arguments. In order to cut down on what was already a dauntingly large patch, I changed the code to never set align attributes in the IR on non-byval indirect arguments. That is, we still generate code which assumes that indirect arguments have the given alignment, but we don't express this information to the backend except where it's semantically required (i.e. on byvals). This is likely a minor regression for those targets that did provide this information, but it'll be trivial to add it back in a later patch. I partially punted on applying this work to CGBuiltin. Please do not add more uses of the CreateDefaultAligned{Load,Store} APIs; they will be going away eventually. llvm-svn: 246985
* [WebAssembly] Initial WebAssembly support in clangDan Gohman2015-09-031-0/+81
| | | | | | | | | | This implements basic support for compiling (though not yet assembling or linking) for a WebAssembly target. Note that ABI details are not yet finalized, and may change. Differential Revision: http://reviews.llvm.org/D12002 llvm-svn: 246814
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-031-0/+20
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246764
* Revert 246755 as it breaks buildbotsOliver Stannard2015-09-031-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | Original commit message: [ARM] Allow passing/returning of __fp16 arguments The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246760
* [ARM] Allow passing/returning of __fp16 argumentsOliver Stannard2015-09-031-0/+18
| | | | | | | | | | | | | | | | | | | | | The ACLE (ARM C Language Extensions) 2.0 allows the __fp16 type to be used as a functon argument or return type (ACLE 1.1 did not). The current public release of the AAPCS (2.09) states that __fp16 values should be converted to single-precision before being passed or returned, but AAPCS 2.10 (to be released shortly) changes this, so that they are passed in the least-significant 16 bits of either a GPR (for base AAPCS) or a single-precision register (for AAPCS-VFP). This does not change how arguments are passed if they get passed on the stack. This patch brings clang up to compliance with the latest versions of both of these specs. We can now set the __ARM_FP16_ARGS ACLE predefine, and we have always been able to set the __ARM_FP16_FORMAT_IEEE predefine (we do not support the alternative format). llvm-svn: 246755
* Remove raw_svector_ostream::resync and users. It's no-op after r244870.Yaron Keren2015-08-131-2/+0
| | | | llvm-svn: 244888
* Correct x86_64 fp128 calling conventionChih-Hung Hsieh2015-08-101-12/+27
| | | | | | | | | | | | | | | | These changes are for Android x86_64 targets to be compatible with current Android g++ and conform to AMD64 ABI. https://llvm.org/bugs/show_bug.cgi?id=23897 * Return type of long double (fp128) should be fp128, not x86_fp80. * Vararg of long double (fp128) could be in register and overflowed to memory. https://llvm.org/bugs/show_bug.cgi?id=24111 * Return value of long double (fp128) _Complex should be in memory like a structure of {fp128,fp128}. Differential Revision: http://reviews.llvm.org/D11437 llvm-svn: 244468
* Fix -Wextra-semi warnings.Hans Wennborg2015-07-221-3/+3
| | | | | | | | Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D11401 llvm-svn: 242931
* Fix quoting of #pragma comment for PS4.Yunzhong Gao2015-07-201-1/+5
| | | | | | | | | | | | This is the PS4 counterpart to r229376, which quotes the library name if the name contains space. It was discovered that if a library name contains both double-quote and space characters, quoting the name might produce unexpected results, but we are mostly concerned with a Windows host environment, which does not allow double-quote or slashes in file/folder names. Differential Revision: http://reviews.llvm.org/D11275 llvm-svn: 242689
* [CodeGen, X86] Classify vectors <= 32 bits as INTEGERDavid Majnemer2015-07-171-6/+8
| | | | | | | | | | We shouldn't crash despite the AMD64 ABI not giving clear guidance as to how to pass around vector types <= 32 bits. Instead, classify such vectors as INTEGER to be compatible with GCC. This fixes PR24162. llvm-svn: 242508
* [MIPS] Add support for direct-to-nacl in ClangPetar Jovanovic2015-07-081-0/+2
| | | | | | | | | | | For Mips direct-to-nacl, the goal is to be close to le32 front-end and use Mips32EL backend. This patch defines new NaClMips32ELTargetInfo and modifies it slightly to be close to le32. It also adds necessary parts, inline with ARM and X86. Differential Revision: http://reviews.llvm.org/D10739 llvm-svn: 241678
* [CodeGen] Correctly handle base classes which are passed in memoryDavid Majnemer2015-07-081-2/+4
| | | | | | | | | | | We didn't correctly process the case where a base class is classified as MEMORY. This would cause us to trip over an assertion. This fixes PR24020. Differential Revision: http://reviews.llvm.org/D10907 llvm-svn: 241667
* [CodeGen] Don't crash classifying a union of an AVX vector and an intDavid Majnemer2015-07-081-0/+2
| | | | | | | | | | | | We forgot to run postMerge after decided that the union had to be classified as MEMORY. This left us with Lo == MEMORY and Hi == SSEUp which is an invalid combination. This fixes PR24021. Differential Revision: http://reviews.llvm.org/D10908 llvm-svn: 241666
* [OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for ↵Alexey Bataev2015-07-021-33/+3
| | | | | | | | | default simd alignment. Adds type trait "__builtin_omp_required_simd_align" after discussions here http://reviews.llvm.org/D9894 Differential Revision: http://reviews.llvm.org/D10597 llvm-svn: 241237
* update commentDerek Schuff2015-06-241-2/+4
| | | | llvm-svn: 240601
* Relax assertion in x86_64 byval argument handling for 32-bit pointersDerek Schuff2015-06-241-1/+2
| | | | | | | | | | | | | | | | Summary: Byval argument pair formation assumes that if a type is less than 8 bytes it must be an integer and not a pointer, which is not true for x32 and NaCl. Relax the assertion and add a test for a codegen case that triggered it. Reviewers: jvoung Subscribers: jfb, cfe-commits Differential Revision: http://reviews.llvm.org/D10701 llvm-svn: 240600
* Silence VC warning C4715: '`anonymous namespace'::getNativeVectorSizeForA ↵Yaron Keren2015-06-231-0/+1
| | | | | | | | VXABI' : not all control paths return a value. llvm-svn: 240389
* Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").Alexander Kornienko2015-06-221-13/+13
| | | | llvm-svn: 240353
* [CodeGen] Teach X86_64ABIInfo about AVX512.Ahmed Bougacha2015-06-221-2/+9
| | | | | | | | | | | | | | | | As specified in the SysV AVX512 ABI drafts. It follows the same scheme as AVX2: Arguments of type __m512 are split into eight eightbyte chunks. The least significant one belongs to class SSE and all the others to class SSEUP. This also means we change the OpenMP SIMD default alignment on AVX512. Based on r240337. Differential Revision: http://reviews.llvm.org/D9894 llvm-svn: 240338
* [CodeGen] Use enum for AVX level in X86*TargetCodeGenInfo. NFCI.Ahmed Bougacha2015-06-221-21/+44
| | | | | | | Follow-up to r237989: expressing the AVX level as an enum makes it simple to extend it with AVX512. llvm-svn: 240337
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-221-13/+13
| | | | | | | | | | | | The patch is generated using this command: $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ work/llvm/tools/clang To reduce churn, not touching namespaces spanning less than 10 lines. llvm-svn: 240270
* Rename the single non-style conformant function in TargetCodeGenInfoEric Christopher2015-06-051-21/+21
| | | | | | and update all callers. llvm-svn: 239193
* [x86-64 ABI] Fix for PR23082: an assertion failure when passing/returning a ↵Andrea Di Biagio2015-06-021-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wrapper union in a full YMM register. This patch fixes an assertion failure in method 'X86_64ABIInfo::GetByteVectorType'. Method 'GetByteVectorType' (in TargetInfo.cpp) is responsible for mapping a QualType 'Ty' (for an argument or return value) to an LLVM IR type that, according to the ABI, must be passed in a XMM/YMM vector register. When selecting the IR vector type, method 'GetByteVectorType' always tries to choose the "best" IR vector type for the 'Ty' in input. In particular, if Ty is a wrapper structure, it keeps unwrapping it until it finds a vector type VTy. That VTy is the "preferred IR type". However, function 'isSingleElementStructure' (used to unwrap structures) does not know how to look through union types. So, before this patch, if Ty was in a nest of wrapper structures with at least two union types, we would have triggered an assertion failure (added at revision 230971). With this patch, if method 'GetByteVectorType' fails to find the preferred vector type, we just return a valid (although potentially 'less friendly') vector type based on the type size. So, rather than asserting on an 'unexpected' 'Ty' in input, we conservatively return vector type <2 x double> if Ty is 16 bytes, or <4 x double> if Ty is 32 bytes. Differential Revision: http://reviews.llvm.org/D10190 llvm-svn: 238861
* Fix 80-column violations.Eric Christopher2015-05-291-60/+77
| | | | llvm-svn: 238630
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-291-1/+1
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [MIPS] Re-land the change r238200 to fix extension of integer typesPetar Jovanovic2015-05-261-0/+15
| | | | | | | | Re-land the change r238200, but with modifications in the tests that should prevent new failures in some environments as reported with the original change on the mailing list. llvm-svn: 238253
* Revert r238200: "[MIPS] fix extension of integer types (function calls)"Hans Wennborg2015-05-261-15/+0
| | | | | | mips-unsigned-ext-var.c and mips-unsigned-extend.c fail in some builds. llvm-svn: 238237
* [MIPS] fix extension of integer types (function calls)Petar Jovanovic2015-05-261-0/+15
| | | | | | | | | | On MIPS unsigned int type should not be zero extended but sign-extended. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D9198 llvm-svn: 238200
* [CodeGen] Use TargetInfo::getABI() throughout X86*TargetCodeGenInfo.Ahmed Bougacha2015-05-221-22/+21
| | | | | | | | | We already have the ABI, we don't need a "HasAVX" flag. This will also makes it easier to add an AVX512 ABI. No functional change intended. llvm-svn: 237989
* Revert changes to DefaultABIInfo accidentally introduced in r208733Reid Kleckner2015-05-181-1/+9
| | | | | | | | | | | | Also add trivial handling of transparent unions. PPC32, MSP430, and XCore apparently all rely on DefaultABIInfo. This should worry you, because DefaultABIInfo is not implementing the rules of any particular ABI. Fixes PR23097, patch by Andy Gibbs. llvm-svn: 237630
OpenPOWER on IntegriCloud