summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Temporary revert r221818 until all the problemsAnton Korobeynikov2014-11-121-9/+0
| | | | | | with objc stuff will be resolved. llvm-svn: 221829
* Fix fallout from r219557Anton Korobeynikov2014-11-121-0/+9
| | | | | | | | | | | | | | | | | Summary: Consider the following nifty 1 liner: (0 ? csqrtl(2.0f) : sqrtl(2.0f)). One can easily obtain such code from e.g. tgmath. Right now it produces an assertion because we fail to do the promotion real => _Complex real. The case was properly handled previously (old handleOtherComplexFloatConversion routine), but was forgotten in the current version. This seems to be about fallout from r219557 Reviewers: chandlerc, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6217 llvm-svn: 221821
* [PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsicsBill Schmidt2014-11-121-0/+48
| | | | | | | | | | | | | | | | | | This patch enables the vec_vsx_ld and vec_vsx_st intrinsics for PowerPC, which provide programmer access to the lxvd2x, lxvw4x, stxvd2x, and stxvw4x instructions. New code in altivec.h defines these in terms of new builtins, which are themselves defined in BuiltinsPPC.def. The builtins are converted to LLVM intrinsics in CGBuiltin.cpp. Additional code is added to builtins-ppc-vsx.c to verify the correct generation of the intrinsics. Note that I moved the other VSX builtins so all VSX builtins will be alphabetical in their own section in BuiltinsPPC.def. There is a companion patch for LLVM. llvm-svn: 221768
* [clang/asan] Do not emit memcpy for trivial operator= when ↵Kostya Serebryany2014-11-111-0/+17
| | | | | | | | | | | | | | | | | | -fsanitize-address-field-padding >= 1 Summary: If we've added poisoned paddings to a type do not emit memcpy for operator=. Test Plan: regression tests. Reviewers: majnemer, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6160 llvm-svn: 221739
* Bundle conditions checked by UBSan with sanitizer kinds they implement.Alexey Samsonov2014-11-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change makes CodeGenFunction::EmitCheck() take several conditions that needs to be checked (all of them need to be true), together with sanitizer kinds these checks are for. This would allow to split one call into UBSan runtime into several calls in case different sanitizer kinds would have different recoverability settings. Tests should be fixed accordingly, I'm working on it. Test Plan: regression test suite. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6219 llvm-svn: 221716
* Simplify the test by using multiple --check-prefix argumentsAlexey Samsonov2014-11-111-253/+160
| | | | llvm-svn: 221713
* ARM ABI: simplify decisions on whether args can be expanded.Tim Northover2014-11-073-18/+13
| | | | | | | | | | | | Homogeneous aggregates on AAPCS_VFP ARM need to be passed *without* being flattened (e.g. [2 x float] rather than "float, float") for various weird ABI reasons. However, this isn't the case for anything else; further, we know at the ABIArgInfo::getDirect callsites whether this flattening is allowed. So, we can get more unified ARM code, with a simpler Clang, by just using that knowledge directly. llvm-svn: 221559
* Since the file has both ppc and ppc64 tests in it rename it.Roman Divacky2014-11-041-0/+0
| | | | llvm-svn: 221285
* Rewrite the test to not require asserts.Roman Divacky2014-11-041-72/+72
| | | | llvm-svn: 221284
* Remove "REQUIRES:shell" from tests. They work for me.NAKAMURA Takumi2014-11-042-3/+0
| | | | llvm-svn: 221269
* Lower __builtin_fabs* to @llvm.fabs.*Reid Kleckner2014-11-031-0/+7
| | | | | | | | | mingw64's headers implement fabs by calling __builtin_fabs, so using the library call results in an infinite loop. If the backend legalizes @llvm.fabs as a call to fabs later, things should work out, as the crt provides a definition. llvm-svn: 221206
* Require asserts to unbreak the buildbots.Roman Divacky2014-11-031-0/+1
| | | | llvm-svn: 221174
* Implement vaarg lowering for ppc32. Lowering of scalars and aggregatesRoman Divacky2014-11-031-0/+81
| | | | | | is supported. Complex numbers are not. llvm-svn: 221170
* Don't dllimport inline functions when targeting MinGW (PR21366)Hans Wennborg2014-11-031-10/+14
| | | | | | | | | | | | It turns out that MinGW never dllimports of exports inline functions. This means that code compiled with Clang would fail to link with MinGW-compiled libraries since we might try to import functions that are not imported. To fix this, make Clang never dllimport inline functions when targeting MinGW. llvm-svn: 221154
* Add FSGSBASE intrinsics to x86 intrinsic headers.Craig Topper2014-11-031-0/+54
| | | | llvm-svn: 221130
* Add _lzcnt_u32 and _lzcnt_u64 to lzcntintrin.h to match Intel documentation ↵Craig Topper2014-11-011-0/+12
| | | | | | names for these intrinsics. llvm-svn: 221066
* Implement IRGen for the x86 vectorcall conventionReid Kleckner2014-10-313-6/+117
| | | | | | | | | | | | | | | The most complex aspect of the convention is the handling of homogeneous vector and floating point aggregates. Reuse the homogeneous aggregate classification code that we use on PPC64 and ARM for this. This convention also has a C mangling, and we apparently implement that in both Clang and LLVM. Reviewed By: majnemer Differential Revision: http://reviews.llvm.org/D6063 llvm-svn: 221006
* [PowerPC] Initial VSX intrinsic support, with min/max for vector doubleBill Schmidt2014-10-311-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have initial support for VSX, we can begin adding intrinsics for programmer access to VSX instructions. This patch performs the necessary enablement in the front end, and tests it by implementing intrinsics for minimum and maximum using the vector double data type. The main change in the front end is to no longer disallow "vector" and "double" in the same declaration (lib/Sema/DeclSpec.cpp), but "vector" and "long double" must still be disallowed. The new intrinsics are accessed via vec_max and vec_min with changes in lib/Headers/altivec.h. Note that for v4f32, we already access corresponding VMX builtins, but with VSX enabled we should use the forms that allow all 64 vector registers. The new built-ins are defined in include/clang/Basic/BuiltinsPPC.def. I've added a new test in test/CodeGen/builtins-ppc-vsx.c that is similar to, but much smaller than, builtins-ppc-altivec.c. This allows us to test VSX IR generation without duplicating CHECK lines for the existing bazillion Altivec tests. Since vector double is now legal when VSX is available, I've modified the error message, and changed where we test for it and for vector long double, since the target machine isn't visible in the old place. This serendipitously removed a not-pertinent warning about 'long' being deprecated when used with 'vector', when "vector long double" is encountered and we just want to issue an error. The existing tests test/Parser/altivec.c and test/Parser/cxx-altivec.cpp have been updated accordingly, and I've added test/Parser/vsx.c to verify that "vector double" is now legitimate with VSX enabled. There is a companion patch for LLVM. llvm-svn: 220989
* ignore -mconstructor-aliases when adding field paddings for asanKostya Serebryany2014-10-311-0/+25
| | | | | | | | | | | | | | | | | | Summary: When we are adding field paddings for asan even an empty dtor has to remain in the code, so we ignore -mconstructor-aliases if the paddings are going to be added. Test Plan: added a test Reviewers: rsmith, rnk, rafael Reviewed By: rafael Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6038 llvm-svn: 220986
* Fix ARM HVA classification of classes with non-virtual basesReid Kleckner2014-10-312-40/+5
| | | | | | | | | | | | | | | | Reuse the PPC64 HVA detection algorithm for ARM and AArch64. This is a nice code deduplication, since they are roughly identical. A few virtual method extension points are needed to understand how big an HVA can be and what element types it can have for a given architecture. Also make the record expansion code work in the presence of non-virtual bases. Reviewed By: uweigand, asl Differential Revision: http://reviews.llvm.org/D6045 llvm-svn: 220972
* [AArch64]Add 2 intrinsics vmov_n_p64/vmovq_n_p64, the alias for ↵Hao Liu2014-10-311-0/+12
| | | | | | | | vdup_n_p64/vdup_n_p64. As this change is too small, commit it directly. llvm-svn: 220946
* test: generalise the test matchingSaleem Abdulrasool2014-10-291-3/+3
| | | | | | The value names may change in different builds, use pattern based tests. llvm-svn: 220861
* CodeGen: add __readfsdword builtinSaleem Abdulrasool2014-10-291-1/+14
| | | | | | | | | The Windows NT SDK uses __readfsdword and declares it as a compiler provided builtin (#pragma intrinsic(__readfsword). Because intrin.h is not referenced by winnt.h, it is not possible to provide an out-of-line definition for the intrinsic. Provide a proper compiler builtin definition. llvm-svn: 220859
* Pass aggregates on the stack without splitting in NVPTX.Eli Bendersky2014-10-291-4/+30
| | | | | | | | | | | Following the NVVM IR specifications, arguments of aggregate type should be passed on the stack without splitting (byval). http://reviews.llvm.org/D6020 Patch by Jacques Pienaar. llvm-svn: 220854
* [PowerPC ABI] Bug 21398 - Consider C++ base classes in HA classificationUlrich Weigand2014-10-291-0/+39
| | | | | | | | As discussed in bug 21398, PowerPC ABI code needs to consider C++ base classes when classifying a class as homogeneous aggregate (or not) for ABI purposes. llvm-svn: 220852
* clang/test/CodeGen/captured-statements-nested.c: Tweak for -Asserts.NAKAMURA Takumi2014-10-291-1/+1
| | | | llvm-svn: 220851
* Improved capturing variable-length array types in CapturedStmt.Alexey Bataev2014-10-292-38/+47
| | | | | | | | An updated implemnentation of VLA types capturing based on previously committed solution for Lambdas. This version captures the whole VLA type instead of particular variables which are part of VLA size expression and allows to use previusly calculated size of VLA type in captured regions. Required for OpenMP. Differential Revision: http://reviews.llvm.org/D5099 llvm-svn: 220850
* Do not insert asan paddings after fields that have flexible arrays.Kostya Serebryany2014-10-271-0/+30
| | | | | | | | | | | | | | | | | | | Summary: We should avoid a tail padding not only if the last field has zero size but also if the last field is a struct with a flexible array. If/when http://reviews.llvm.org/D5478 is committed, this will also handle the case of structs with zero-sized arrays. Reviewers: majnemer, rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5924 llvm-svn: 220708
* Prune CRLF.NAKAMURA Takumi2014-10-271-12/+12
| | | | llvm-svn: 220678
* Make this test a bit stricter by checking clang's output too.Rafael Espindola2014-10-251-1/+1
| | | | llvm-svn: 220604
* Add frontend support for __vectorcallReid Kleckner2014-10-242-3/+12
| | | | | | | | | | | | | Wire it through everywhere we have support for fastcall, essentially. This allows us to parse the MSVC "14" CTP headers, but we will miscompile them because LLVM doesn't support __vectorcall yet. Reviewed By: Aaron Ballman Differential Revision: http://reviews.llvm.org/D5808 llvm-svn: 220573
* [mips] Mark aggregate arguments passed in registers with the inreg attributeDaniel Sanders2014-10-244-15/+15
| | | | | | | | | | | | | | | | | | | Summary: This allows us to easily identify them in the backend which in turn allows us to handle them correctly for big-endian targets (where they must be shifted into the upper bits of the register). Depends on D5961 Reviewers: atanasyan Reviewed By: atanasyan Subscribers: cfe-commits, theraven Differential Revision: http://reviews.llvm.org/D5962 llvm-svn: 220566
* [mips] Promote all integral/enumeration types to the GPR widthDaniel Sanders2014-10-243-21/+21
| | | | | | | | | | | | | | | | | | Summary: Ensure all integral/enumeration types are appropriately annotated with signext/zeroext. In particular, i32 now has these attributes when using the N32/N64 ABI. This paves the way for accurately representing the way the N32/N64 ABI's promotes integer arguments to i64. Reviewers: atanasyan Reviewed By: atanasyan Subscribers: cfe-commits, theraven Differential Revision: http://reviews.llvm.org/D5961 llvm-svn: 220563
* DebugInfo: Omit scopes in -gmlt to reduce metadata size (on disk and in memory)David Blaikie2014-10-221-0/+12
| | | | | | | I haven't done any actual impact analysis of this change as it's a strict improvement, but I'd be curious to know how much it helps. llvm-svn: 220408
* Fixup for r220403: Use getFileLoc() instead of getSpellingLoc() in ↵Alexey Samsonov2014-10-221-1/+7
| | | | | | | | | SanitizerBlacklist. This also handles the case where function name (not its body) is obtained from macro expansion. llvm-svn: 220407
* SanitizerBlacklist: Use spelling location for blacklisting purposes.Alexey Samsonov2014-10-221-0/+9
| | | | | | | | | When SanitizerBlacklist decides if the SourceLocation is blacklisted, we need to first turn it into a SpellingLoc before fetching the filename and scanning "src:" entries. Otherwise we will fail to fecth the correct filename for function definitions coming from macro expansion. llvm-svn: 220403
* Remove including <complex.h> in test case, and change to use _Complex instead.Jiangning Liu2014-10-211-2/+1
| | | | llvm-svn: 220258
* Lower compound assignment for the missing type llvm::Type::FP128TyID.Jiangning Liu2014-10-211-0/+10
| | | | llvm-svn: 220257
* CodeGen: ConstStructBuilder must verify packed constraints after paddingDavid Majnemer2014-10-192-2/+23
| | | | | | | | | | | | | | | | | | This reverts commit r220169 which reverted r220153. However, it also contains additional changes: - We may need to add padding *after* we've packed the struct. This occurs when the aligned next field offset is greater than the new field's offset. When this occurs, we make the struct packed. *However*, once packed the next field offset might be less than the new feild's offset. It is in this case that we might further pad the struct. - We would pad structs which were perfectly sized! This behavior is immensely old. This behavior came from blindly subtracting NextFieldOffsetInChars from RecordSize. This doesn't take into account the fact that the struct might have a greater overall alignment than the last field. llvm-svn: 220175
* Revert r220153: "CodeGen: ConstStructBuilder must verify packed constraints ↵Chandler Carruth2014-10-191-11/+0
| | | | | | | | | | after padding" This commit caused two tests in LNT to regress. I'm able to reproduce on any platform and will send reproduction steps to the original commit log. This should restore the LNT bots that have been failing. llvm-svn: 220169
* [complex] Teach the complex math IR gen to emit direct math andChandler Carruth2014-10-191-4/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | a NaN-test prior to the call to the library function. This should automatically make fastmath (including just non-NaNs) able to avoid the expensive libcalls and also open the door to more advanced folding in LLVM based on the rules for complex math. Two important notes to remember: first is that this isn't yet a proper limited range mode, it's still just improving the unlimited range mode. Also, it isn't really perfecet w.r.t. what an unlimited range mode should be doing because it isn't quite handling the flags produced by all the operations in the way desirable for that mode, but then neither is compiler-rt's libcall. When the compiler-rt libcall is improved to carefully manage flags, the code emitted here should be improved correspondingly. And it is still a long-term desirable thing to add a limited range mode to Clang that would be able to use direct math without library calls here. Special thanks to Steve Canon for the careful review on this patch and teaching me about these issues. =D Differential Revision: http://reviews.llvm.org/D5756 llvm-svn: 220167
* CodeGen: ConstStructBuilder must verify packed constraints after paddingDavid Majnemer2014-10-191-0/+11
| | | | | | | | | | | | Before, ConstStructBuilder::AppendBytes would check packed constraints prior to padding being added before the field's offset. However, adding this padding might force our struct to be packed. Because we wouldn't check *after* adding padding, ConstStructBuilder would be in an inconsistent state leading to a crash. This fixes PR21300. llvm-svn: 220153
* [ASan] Improve blacklisting of global variables.Alexey Samsonov2014-10-172-11/+28
| | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way we blacklist global variables in ASan. Now the global is excluded from instrumentation (either regular bounds checking, or initialization-order checking) if: 1) Global is explicitly blacklisted by its mangled name. This part is left unchanged. 2) SourceLocation of a global is in blacklisted source file. This changes the old behavior, where instead of looking at the SourceLocation of a variable we simply considered llvm::Module identifier. This was wrong, as identifier may not correspond to the file name, and we incorrectly disabled instrumentation for globals coming from #include'd files. 3) Global is blacklisted by type. Now we build the type of a global variable using Clang machinery (QualType::getAsString()), instead of llvm::StructType::getName(). After this commit, the active users of ASan blacklist files may have to revisit them (this is a backwards-incompatible change). llvm-svn: 220097
* fix -fsanitize-address-field-padding for the cases with virtual base classesKostya Serebryany2014-10-171-0/+26
| | | | | | | | | | | | | | | | Summary: Correctly compute the non-virtual size of a class. Test Plan: Build SPEC 2016 with -fsanitize-address-field-padding Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5848 llvm-svn: 220089
* Move test/CodeGen/sections.c to CodeGenCXX/sections.cppHans Wennborg2014-10-171-61/+0
| | | | | | The test was running with -xc++. Seems it wants to be a C++ file. llvm-svn: 220069
* Add explicit triple to ↵NAKAMURA Takumi2014-10-171-2/+2
| | | | | | clang/test/CodeGen/sanitize-address-field-padding.cpp, for now. It's incompatible to ms mangling. llvm-svn: 220037
* complex long double support for PowerPCJoerg Sonnenberger2014-10-171-0/+13
| | | | llvm-svn: 220034
* User c-tor name to fix the sanitizer testRenato Golin2014-10-171-1/+1
| | | | llvm-svn: 220030
* Trying to fix failing Clang sanitizer test on ARM botsRenato Golin2014-10-171-1/+1
| | | | llvm-svn: 220029
* trying to fix the new test again, this time for the clang-cmake-armv7-a15 botKostya Serebryany2014-10-171-16/+3
| | | | llvm-svn: 220002
OpenPOWER on IntegriCloud