summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Implement AArch64 vector load/store multiple N-element structure class ↵Hao Liu2013-10-101-0/+34
| | | | | | | | | | | | SIMD(lselem). Including following 14 instructions: 4 ld1 insts: load multiple 1-element structure to sequential 1/2/3/4 registers. ld2/ld3/ld4: load multiple N-element structure to sequential N registers (N=2,3,4). 4 st1 insts: store multiple 1-element structure from sequential 1/2/3/4 registers. st2/st3/st4: store multiple N-element structure from sequential N registers (N = 2,3,4). llvm-svn: 192362
* Revert "Implement AArch64 vector load/store multiple N-element structure ↵Tim Northover2013-10-101-34/+0
| | | | | | | | | class SIMD(lselem). " This reverts commit r192351. The LLVM side broke the build and the Clang tests will inevitably fail without it. llvm-svn: 192356
* Revert "Use aliases for more constructors and destructors."Rafael Espindola2013-10-101-6/+21
| | | | | | | | | This reverts commit r192300. The change itself looks correct, but it found issues on how we handle aliases in llvm. llvm-svn: 192353
* Implement AArch64 vector load/store multiple N-element structure class ↵Hao Liu2013-10-101-0/+34
| | | | | | | | | | | | | | | SIMD(lselem). Including following 14 instructions: 4 ld1 insts: load multiple 1-element structure to sequential 1/2/3/4 registers. ld2/ld3/ld4: load multiple N-element structure to sequential N registers (N=2,3,4). 4 st1 insts: store multiple 1-element structure from sequential 1/2/3/4 registers. st2/st3/st4: store multiple N-element structure from sequential N registers (N = 2,3,4). E.g. ld1(3 registers version) will load 32-bit elements {A, B, C, D, E, F} sequentially into the three 64-bit vectors list {BA, DC, FE}. E.g. ld3 will load 32-bit elements {A, B, C, D, E, F} into the three 64-bit vectors list {DA, EB, FC}. llvm-svn: 192351
* Initialize vtorDisp in class constructors and destructorsTimur Iskhodzhanov2013-10-093-0/+67
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D1867 llvm-svn: 192312
* Use aliases for more constructors and destructors.Rafael Espindola2013-10-091-21/+6
| | | | | | | | | | | | | | | | With this patch we produce alias for cases like template<typename T> struct foobar { foobar() { } }; template struct foobar<void>; It is safe to use aliases to weak symbols, as long and the alias itself is also weak. llvm-svn: 192300
* Code cleanup: rename VTableContext to ItaniumVTableContext, VTableBuilder to ↵Timur Iskhodzhanov2013-10-094-6/+8
| | | | | | ItaniumVTableBuilder and clang-format code around llvm-svn: 192288
* Reland 192220 "Abstract out parts of thunk emission code, add support for ↵Timur Iskhodzhanov2013-10-095-34/+55
| | | | | | simple thunks when using -cxx-abi microsoft" with relaxed assertions llvm-svn: 192285
* [AArch64] Add support for NEON scalar floating-point reciprocal estimate,Chad Rosier2013-10-081-0/+15
| | | | | | reciprocal exponent, and reciprocal square root estimate instructions. llvm-svn: 192243
* [AArch64] Add support for NEON scalar signed/unsigned integer to floating-pointChad Rosier2013-10-081-0/+14
| | | | | | convert instructions. llvm-svn: 192232
* Revert 192220 as it fails on an assertionTimur Iskhodzhanov2013-10-085-55/+34
| | | | llvm-svn: 192225
* Abstract out parts of thunk emission code, add support for simple thunks ↵Timur Iskhodzhanov2013-10-085-34/+55
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1787 llvm-svn: 192220
* TBAA: use the same format for scalar TBAA and struct-path aware TBAA.Manman Ren2013-10-083-19/+22
| | | | | | | | | | | | | | | | An updated version of r191586 with bug fix. Struct-path aware TBAA generates tags to specify the access path, while scalar TBAA only generates tags to scalar types. We should not generate a TBAA tag with null being the first field. When a TBAA type node is null, the tag should be null too. Make sure we don't decorate an instruction with a null TBAA tag. Added a testing case for the bug reported by Richard with -relaxed-aliasing and -fsanitizer=thread. llvm-svn: 192145
* Fix objectsize tests after r192117Matt Arsenault2013-10-072-3/+6
| | | | llvm-svn: 192120
* [AArch64] Add support for NEON scalar arithmetic instructions:Chad Rosier2013-10-071-0/+25
| | | | | | SQDMULH, SQRDMULH, FMULX, FRECPS, and FRSQRTS. llvm-svn: 192112
* remove a dead assignment. The variables are set just right after. Found by ↵Sylvestre Ledru2013-10-061-1/+1
| | | | | | scan-build http://buildd-clang.debian.net/scan-build/ llvm-svn: 192061
* Pass CGCXXABIs around directly.Mark Lacey2013-10-062-26/+33
| | | | | | | | | | In functions that only need to use the CGCXXABI member of a CodeGenTypes class, pass that reference around directly rather than a reference to a CodeGenTypes class. This makes the actual dependence on CGCXXABI clear at the call sites. llvm-svn: 192052
* Implement aarch64 neon instruction set AdvSIMD (Across).Jiangning Liu2013-10-051-111/+147
| | | | llvm-svn: 192029
* Do not emit undefined lsrh/ashr for NEON shiftsAmaury de la Vieuville2013-10-042-12/+37
| | | | | | | | These IR instructions are undefined when the amount is equal to operand size, but NEON right shifts support such shifts. Work around that by emitting a different IR in these cases. llvm-svn: 191953
* Implement aarch64 neon instruction set AdvSIMD (3V elem).Jiangning Liu2013-10-041-0/+40
| | | | llvm-svn: 191945
* Extract ABI-specific parts of MangleContext into separate classesTimur Iskhodzhanov2013-10-035-12/+22
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D1807 llvm-svn: 191878
* Use the CGCXXABI member on CodeGenTypes.Mark Lacey2013-10-022-4/+3
| | | | | | | | | | CodeGenTypes already has a reference to a CGCXXABI. Use this directly rather than going through CodeGenModule to get to the same information. This is consistent with other references to CGCXXABI in CodeGenTypes functions defined in CGCall.cpp. llvm-svn: 191854
* Fix crashes when creating global instances of polymorphic classes without fieldsTimur Iskhodzhanov2013-10-021-1/+2
| | | | | | Reviewed at http://llvm-reviews.chandlerc.com/D1795 llvm-svn: 191839
* [ARM] Add a builtin to allow you to use the 'sevl' instruction.Joey Gouly2013-10-021-0/+5
| | | | llvm-svn: 191816
* Fix build breakage, missed committing a chunk of a patch.Nick Lewycky2013-10-021-1/+1
| | | | llvm-svn: 191809
* Thread a SourceLocation into the EmitCheck for "load_invalid_value". This occursNick Lewycky2013-10-0215-133/+182
| | | | | | when scalars are loaded / undergo lvalue-to-rvalue conversion. llvm-svn: 191808
* No functionality change. Reflow lines that could fit on one line. Break linesNick Lewycky2013-10-017-29/+20
| | | | | | that had 80-column violations. Remove spurious emacs mode markers on .cpp files. llvm-svn: 191797
* Implement ARM GNU-style interrupt attributeTim Northover2013-10-011-1/+40
| | | | | | | | | | This attribute allows users to use a modified C or C++ function as an ARM exception-handling function and, with care, to successfully return control to user-space after the issue has been dealt with. rdar://problem/14207019 llvm-svn: 191769
* Revert r191586 and r191695. They cause crashes when building withRichard Smith2013-10-012-10/+15
| | | | | | -relaxed-aliasing. llvm-svn: 191725
* Implement conversion to function pointer for generic lambdas without captures.Faisal Vali2013-09-292-13/+22
| | | | | | | | | | | | | | | | The general strategy is to create template versions of the conversion function and static invoker and then during template argument deduction of the conversion function, create the corresponding call-operator and static invoker specializations, and when the conversion function is marked referenced generate the body of the conversion function using the corresponding static-invoker specialization. Similarly, Codegen does something similar - when asked to emit the IR for a specialized static invoker of a generic lambda, it forwards emission to the corresponding call operator. This patch has been reviewed in person both by Doug and Richard. Richard gave me the LGTM. A few minor changes: - per Richard's request i added a simple check to gracefully inform that captures (init, explicit or default) have not been added to generic lambdas just yet (instead of the assertion violation). - I removed a few lines of code that added the call operators instantiated parameters to the currentinstantiationscope. Not only did it not handle parameter packs, but it is more relevant in the patch for nested lambdas which will follow this one, and fix that problem more comprehensively. - Doug had commented that the original implementation strategy of using the TypeSourceInfo of the call operator to create the static-invoker was flawed and allowed const as a member qualifier to creep into the type of the static-invoker. I currently kludge around it - but after my initial discussion with Doug, with a follow up session with Richard, I have added a FIXME so that a more elegant solution that involves the use of TrivialTypeSourceInfo call followed by the correct wiring of the template parameters to the functionprototypeloc is forthcoming. Thanks! llvm-svn: 191634
* TBAA: use the same format for scalar TBAA and struct-path aware TBAA.Manman Ren2013-09-272-15/+10
| | | | | | | Struct-path aware TBAA generates tags to specify the access path, while scalar TBAA only generates tags to scalar types. llvm-svn: 191586
* Abstract out the emission of vtables, add basic support for vtable emission ↵Timur Iskhodzhanov2013-09-2711-169/+327
| | | | | | | | when using -cxx-abi microsoft Reviewed at http://llvm-reviews.chandlerc.com/D1532 llvm-svn: 191523
* AST: Handle qualified array types in typeid() expressionsDavid Majnemer2013-09-272-3/+3
| | | | | | | | | | | | The intent of getTypeOperand() was to yield an unqualified type. However QualType::getUnqualifiedType() does not strip away qualifiers on arrays. N.B. This worked fine when typeid() was applied to an expression because we would inject as implicit cast to the unqualified array type in the AST. llvm-svn: 191487
* Debug info: Fix a crash when trying to construct a type with redundantAdrian Prantl2013-09-261-1/+5
| | | | | | | ownership qualifiers. Fixes rdar://problem/14990656. llvm-svn: 191463
* Implement a rudimentary form of generic lambdas.Faisal Vali2013-09-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, the following features are not included in this commit: - any sort of capturing within generic lambdas - generic lambdas within template functions and nested within other generic lambdas - conversion operator for captureless lambdas - ensuring all visitors are generic lambda aware (Although I have gotten some useful feedback on my patches of the above and will be incorporating that as I submit those patches for commit) As an example of what compiles through this commit: template <class F1, class F2> struct overload : F1, F2 { using F1::operator(); using F2::operator(); overload(F1 f1, F2 f2) : F1(f1), F2(f2) { } }; auto Recursive = [](auto Self, auto h, auto ... rest) { return 1 + Self(Self, rest...); }; auto Base = [](auto Self, auto h) { return 1; }; overload<decltype(Base), decltype(Recursive)> O(Base, Recursive); int num_params = O(O, 5, 3, "abc", 3.14, 'a'); Please see attached tests for more examples. This patch has been reviewed by Doug and Richard. Minor changes (non-functionality affecting) have been made since both of them formally looked at it, but the changes involve removal of supernumerary return type deduction changes (since they are now redundant, with richard having committed a recent patch to address return type deduction for C++11 lambdas using C++14 semantics). Some implementation notes: - Add a new Declarator context => LambdaExprParameterContext to clang::Declarator to allow the use of 'auto' in declaring generic lambda parameters - Add various helpers to CXXRecordDecl to facilitate identifying and querying a closure class - LambdaScopeInfo (which maintains the current lambda's Sema state) was augmented to house the current depth of the template being parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth) so that SemaType.cpp::ConvertDeclSpecToType may use it to immediately generate a template-parameter-type when 'auto' is parsed in a generic lambda parameter context. (i.e we do NOT use AutoType deduced to a template parameter type - Richard seemed ok with this approach). We encode that this template type was generated from an auto by simply adding $auto to the name which can be used for better diagnostics if needed. - SemaLambda.h was added to hold some common lambda utility functions (this file is likely to grow ...) - Teach Sema::ActOnStartOfFunctionDef to check whether it is being called to instantiate a generic lambda's call operator, and if so, push an appropriately prepared LambdaScopeInfo object on the stack. - various tests were added - but much more will be needed. There is obviously more work to be done, and both Richard (weakly) and Doug (strongly) have requested that LambdaExpr be removed form the CXXRecordDecl LambdaDefinitionaData in a future patch which is forthcoming. A greatful thanks to all reviewers including Eli Friedman, James Dennett, and especially the two gracious wizards (Richard Smith and Doug Gregor) who spent hours providing feedback (in person in Chicago and on the mailing lists). And yet I am certain that I have allowed unidentified bugs to creep in; bugs, that I will do my best to slay, once identified! Thanks! llvm-svn: 191453
* Mark an impossible path as unreachable to pacify GCC.Benjamin Kramer2013-09-261-0/+1
| | | | llvm-svn: 191436
* Remove tabs.Benjamin Kramer2013-09-261-91/+91
| | | | llvm-svn: 191427
* CGBuiltin.cpp: Prune a stray default: label. [-Wcovered-switch-default]NAKAMURA Takumi2013-09-241-2/+0
| | | | llvm-svn: 191277
* Initial support for Neon scalar instructions.Jiangning Liu2013-09-241-8/+228
| | | | | | | | | | Patch by Ana Pazos. 1.Added support for v1ix and v1fx types. 2.Added Scalar Pairwise Reduce instructions. 3.Added initial implementation of Scalar Arithmetic instructions. llvm-svn: 191264
* Add _mm_stream_si64 intrinsic.Eli Friedman2013-09-231-2/+12
| | | | | | | | | While I'm here, also fix the alignment computation for the whole family of intrinsics. PR17298. llvm-svn: 191243
* get rid of extra parentheses.Adrian Prantl2013-09-181-2/+1
| | | | llvm-svn: 190962
* Debug info: Explicitly set the DIVariable::isIndirect() flag for VLAs.Adrian Prantl2013-09-181-0/+2
| | | | | | | This allows us to get rid of an ugly hack in the backend. Paired commit with LLVM. llvm-svn: 190960
* [ARMv8] Add builtins for CRC instructions.Joey Gouly2013-09-181-0/+43
| | | | | | Patch by Bradley Smith! llvm-svn: 190931
* Add the intrinsic __builtin_convertvectorHal Finkel2013-09-181-0/+76
| | | | | | | | | | | | | | | | | | LLVM supports applying conversion instructions to vectors of the same number of elements (fptrunc, fptosi, etc.) but there had been no way for a Clang user to cause such instructions to be generated when using builtin vector types. C-style casting on vectors is already defined in terms of bitcasts, and so cannot be used for these conversions as well (without leading to a very confusing set of semantics). As a result, this adds a __builtin_convertvector intrinsic (patterned after the OpenCL __builtin_astype intrinsic). This is intended to aid the creation of vector intrinsic headers that create generic IR instead of target-dependent intrinsics (in other words, this is a generic _mm_cvtepi32_ps). As noted in the documentation, the action of __builtin_convertvector is defined in terms of the action of a C-style cast on each vector element. llvm-svn: 190915
* Emit an error when attempting to generate IR for SEH __tryReid Kleckner2013-09-163-1/+7
| | | | | | | Currently we silently omit the code in the try and finally bodies, which is pretty bad. This way we fail loudly. llvm-svn: 190809
* Clean up some Triple usage in clang.Cameron Esfahani2013-09-142-3/+3
| | | | llvm-svn: 190737
* DebugInfo: omit debug info for friendsDavid Blaikie2013-09-132-23/+0
| | | | | | | | | GCC ToT doesn't do this & it's worth about 3.2% on Clang's DWO file size with Clang. Some or all of this may be due to things like r190715 which could have source fixes/improvements, but it's not clear that's the case and that doesn't help other source bases. llvm-svn: 190716
* Restore the sqrt -> llvm.sqrt mapping in fast-math modeHal Finkel2013-09-121-6/+13
| | | | | | | | | | | | | | | This restores the sqrt -> llvm.sqrt mapping, but only in fast-math mode (specifically, when the UnsafeFPMath or NoNaNsFPMath CodeGen options are enabled). The @llvm.sqrt* intrinsics have slightly different semantics from the libm call, specifically, they are undefined when given a non-zero negative number (the libm calls will always return NaN for any negative number). This mapping was removed in r100613, and replaced with a TODO, but at that time the fast-math flags were not yet implemented. Now that we have these, restoring this mapping is important because it will enable autovectorization of sqrt calls in loops (at least in fast-math mode). llvm-svn: 190646
* Fix 2 cases of uninitialized reads of an invalid PresumedLoc.Evgeniy Stepanov2013-09-111-2/+2
| | | | | | | | | The code in CGExpr was added back in 2012 (r165536) but not exercised in tests until recently. Detected on the MemorySanitizer bootstrap bot. llvm-svn: 190521
* Disable the bool and enum sanitizers when emitting the implicitly-defined copyNick Lewycky2013-09-111-8/+33
| | | | | | constructor, copy assignment operator and move assignment operator. llvm-svn: 190481
OpenPOWER on IntegriCloud