summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* CodeGen: Let arrays be inputs to inline asmDavid Majnemer2014-07-142-0/+14
| | | | | | | | | | | An array showing up in an inline assembly input is accepted in ICC and GCC 4.8 This fixes PR20201. Differential Revision: http://reviews.llvm.org/D4382 llvm-svn: 212954
* ARM: Add NOP intrinsic mapping in arm_acle.hYi Kong2014-07-141-0/+8
| | | | llvm-svn: 212950
* ARM: Implement __builtin_arm_nop intrinsicYi Kong2014-07-142-0/+7
| | | | | | | | | | | This patch implements __builtin_arm_nop intrinsic for AArch32 and AArch64, which generates hint 0x0, the alias of NOP instruction. This intrinsic is necessary to implement ACLE __nop intrinsic. Differential Revision: http://reviews.llvm.org/D4495 llvm-svn: 212947
* Add test cases for AArch64 hints codegenYi Kong2014-07-131-0/+8
| | | | llvm-svn: 212909
* tests: use a more precise target for testsSaleem Abdulrasool2014-07-121-2/+2
| | | | llvm-svn: 212892
* CodeGen: support hint intrinsics from ACLE on AArch64Saleem Abdulrasool2014-07-121-0/+37
| | | | | | | This adds support for the ACLE hint intrinsics on AArch64 similar to ARM. This is required to properly support ACLE on AArch64. llvm-svn: 212890
* Improve comments of ARM ACLE header file and testsYi Kong2014-07-121-3/+8
| | | | | | Include section number in ARM ACLE specification for easier navigation. llvm-svn: 212887
* Add nonnull in CodeGen for __attribute__((returns_nonnull))Hal Finkel2014-07-121-0/+6
| | | | | | | As a follow-up to r212835, also add the LLVM nonnull function attribute when __attribute__((returns_nonnull)) is provided. llvm-svn: 212874
* [ASan] Collect unmangled names of global variables in Clang to print them in ↵Alexey Samsonov2014-07-121-10/+14
| | | | | | | | | | | | | | | | | error reports. Currently ASan instrumentation pass creates a string with global name for each instrumented global (to include global names in the error report). Global name is already mangled at this point, and we may not be able to demangle it at runtime (e.g. there is no __cxa_demangle on Android). Instead, create a string with fully qualified global name in Clang, and pass it to ASan instrumentation pass in llvm.asan.globals metadata. If there is no metadata for some global, ASan will use the original algorithm. This fixes https://code.google.com/p/address-sanitizer/issues/detail?id=264. llvm-svn: 212872
* Form a CallExpr from __noop without parensReid Kleckner2014-07-111-5/+22
| | | | | | | | | | | | MSVC accepts __noop without any trailing parens and treats it like a literal zero. We don't treat __noop as an integer literal, but now at least we can parse a naked __noop expression. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D4476 llvm-svn: 212860
* MS extension: Make __noop be the integer zero, not voidReid Kleckner2014-07-111-3/+3
| | | | | | | We still don't accept '__noop;', and we don't consider __noop to be the integer literal zero. More work is needed. llvm-svn: 212839
* Add nonnull in CodeGen for __attribute__((nonnull))Hal Finkel2014-07-111-0/+17
| | | | | | | | We now have an LLVM-level nonnull attribute that can be applied to function parameters, and we emit it for reference types (as of r209723), but did not emit it when an __attribute__((nonnull)) was provided. Now we will. llvm-svn: 212835
* [UBSan] Introduce type-based blacklisting.Alexey Samsonov2014-07-101-0/+25
| | | | | | | | | Teach UBSan vptr checker to ignore technically invalud down-casts on blacklisted types. Based on http://reviews.llvm.org/D4407 by Byoungyoung Lee! llvm-svn: 212770
* Fix (and reenable) ppc64-align-struct.c test for non-assert builds.Ulrich Weigand2014-07-101-37/+36
| | | | llvm-svn: 212757
* Quick (attempted) fix for non-asserts builds for a test introduced in r212743.David Blaikie2014-07-101-0/+1
| | | | llvm-svn: 212752
* [PowerPC] ABI support for aligned by-value aggregatesUlrich Weigand2014-07-102-1/+137
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for respecting the ABI and type alignment of aggregates passed by value. Currently, all aggregates are aligned at 8 bytes in the parameter save area. This is incorrect for two reasons: - Aggregates that need alignment of 16 bytes or more should be aligned at 16 bytes in the parameter save area. This is implemented by using an appropriate "byval align" attribute in the IR. - Aggregates that need alignment beyond 16 bytes need to be dynamically realigned by the caller. This is implemented by setting the Realign flag of the ABIArgInfo::getIndirect call. In addition, when expanding a va_arg call accessing a type that is aligned at 16 bytes in the argument save area (either one of the aggregate types as above, or a vector type which is already aligned at 16 bytes), code needs to align the va_list pointer accordingly. Reviewed by Hal Finkel. llvm-svn: 212743
* [PowerPC] ABI support for non-Altivec vector typesUlrich Weigand2014-07-101-0/+52
| | | | | | | | | | | | | | | | | | | | | This patch adds support for passing arguments of non-Altivec vector type (i.e. defined via attribute ((vector_size (...)))) on powerpc64-linux. While such types are not mentioned in the formal ABI document, this patch implements a calling convention compatible with GCC: - Vectors of size < 16 bytes are passed in a GPR - Vectors of size > 16 bytes are passed via reference Note that vector types with a number of elements that is not a power of 2 are not supported by GCC, so there is no pre-existing ABI to follow. We choose to pass those (of size < 16) as if widened to the next power of two, so they might end up in a vector register or in a GPR. (Sizes > 16 are always passed via reference as well.) Reviewed by Hal Finkel. llvm-svn: 212734
* [mips] clz is defined to give 32 for zero. Similarly, dclz gives 64.Daniel Sanders2014-07-091-0/+32
| | | | | | | | | | | | | | | Summary: While debugging another issue, I noticed that Mips currently specifies that the count leading zero builtins are undefined when the input is zero. The architecture specifications say that the clz and dclz instructions write 32 or 64 respectively when given zero. This doesn't fix any bugs that I'm aware of but it may improve optimisation in some cases. Differential Revision: http://reviews.llvm.org/D4431 llvm-svn: 212618
* ARM: use LLVM's atomicrmw instructions when ldrex/strex are available.Tim Northover2014-07-093-0/+107
| | | | | | | | | | | | | | Having some kind of weird kernel-assisted ABI for these when the native instructions are available appears to be (and should be) the exception; OSs have been gradually opting in for years and the code was getting silly. So let LLVM decide whether it's possible/profitable to inline them by default. Patch by Phoebe Buckheister. llvm-svn: 212598
* [Sanitizer] Reduce the usage of sanitizer blacklist in CodeGenModuleAlexey Samsonov2014-07-071-0/+9
| | | | | | | | | | | | | | | | Get rid of cached CodeGenModule::SanOpts, which was used to turn off sanitizer codegen options if current LLVM Module is blacklisted, and use plain LangOpts.Sanitize instead. 1) Some codegen decisions (turning TBAA or writable strings on/off) shouldn't depend on the contents of blacklist. 2) llvm.asan.globals should *always* be created, even if the module is blacklisted - soon Clang's CodeGen where we read sanitizer blacklist files, so we should properly report which globals are blacklisted to the backend. llvm-svn: 212499
* Add an AST node for __leave statements, hook it up.Nico Weber2014-07-071-0/+1
| | | | | | | Codegen is still missing (and I won't work on that), but __leave is now as implemented as __try and friends. llvm-svn: 212425
* Add support for nested blocks in Microsoft inline assemblyEhsan Akhgari2014-07-062-4/+11
| | | | | | This fixes http://llvm.org/PR20204. llvm-svn: 212389
* CodeGen: add support for a few MSVC ARM intrinsicsSaleem Abdulrasool2014-07-051-0/+63
| | | | | | | | This adds support for simple MSVC compatibility mode intrinsics. These intrinsics are simple in that they are either directly passed through to the annotated MSBuiltin intrinsic or they mirror existing GCC builtins. llvm-svn: 212378
* Add a test case for the tilde operator in Microsoft inline assemblyEhsan Akhgari2014-07-051-0/+2
| | | | llvm-svn: 212373
* Fixed test CodeGen/captured-statements.c for powerpc64-linux.Alexey Bataev2014-07-041-2/+2
| | | | llvm-svn: 212311
* Restore global static array in test caseGerolf Hoflehner2014-07-031-1/+1
| | | | llvm-svn: 212285
* [ARM] Implement ISB memory barrier intrinsicYi Kong2014-07-031-0/+1
| | | | | | | Adds support for __builtin_arm_isb. Also corrects DSB and ISB instructions modelling by adding has-side-effects property. llvm-svn: 212277
* Add the __qdbl intrinsic to the arm_acle.h headerRenato Golin2014-07-031-0/+9
| | | | | | Patch by: Moritz Roth llvm-svn: 212264
* Move the calling of emitTargetMD() later.Robert Lytton2014-07-031-40/+51
| | | | | | | | | | | | | | | | Summary: Because a global created by GetOrCreateLLVMGlobal() is not finalised until later viz: extern char a[]; char f(){ return a[5];} char a[10]; Change MangledDeclNames to use a MapVector rather than a DenseMap so that the Metadata is output in order of original declaration, so to make deterministic and improve human readablity. Differential Revision: http://reviews.llvm.org/D4176 llvm-svn: 212263
* ARMEB: Fix function result return for composite typesChristian Pirker2014-07-031-0/+37
| | | | | | Reviewed at http://reviews.llvm.org/D4364 llvm-svn: 212261
* ARM: rename ARM builtins to use __builtin_arm prefixSaleem Abdulrasool2014-07-031-5/+5
| | | | | | | | | This corrects SVN r212196's naming change to use the proper prefix of `__builtin_arm_` instead of `__builtin_`. Thanks to Yi Kong for pointing out the incorrect naming! llvm-svn: 212253
* CodeGen: make target builtins support languagesSaleem Abdulrasool2014-07-022-8/+40
| | | | | | | | | | This extends the target builtin support to allow language specific annotations (i.e. LANGBUILTIN). This is to allow MSVC compatibility whilst retaining the ability to have EABI targets use a __builtin_ prefix. This is merely to allow uniformity in the EABI case where the unprefixed name is provided as an alias in the header. llvm-svn: 212196
* [ASan] Print exact source location of global variables in error reports.Alexey Samsonov2014-07-022-3/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://code.google.com/p/address-sanitizer/issues/detail?id=299 for the original feature request. Introduce llvm.asan.globals metadata, which Clang (or any other frontend) may use to report extra information about global variables to ASan instrumentation pass in the backend. This metadata replaces llvm.asan.dynamically_initialized_globals that was used to detect init-order bugs. llvm.asan.globals contains the following data for each global: 1) source location (file/line/column info); 2) whether it is dynamically initialized; 3) whether it is blacklisted (shouldn't be instrumented). Source location data is then emitted in the binary and can be picked up by ASan runtime in case it needs to print error report involving some global. For example: 0x... is located 4 bytes to the right of global variable 'C::array' defined in '/path/to/file:17:8' (0x...) of size 40 These source locations are printed even if the binary doesn't have any debug info. This is an ABI-breaking change. ASan initialization is renamed to __asan_init_v4(). Pre-built libraries compiled with older Clang will not work with the fresh runtime. llvm-svn: 212188
* ARM: add support for v8 ldaex/stlex builtins.Tim Northover2014-07-021-1/+162
| | | | | | | | | | | | | | ARMv8 adds (to both AArch32 and AArch64) acquiring and releasing variants of the exclusive operations, in line with the C++11 memory model. This adds support for two new intrinsics to expose them to C & C++ developers directly: __builtin_arm_ldaex and __builtin_arm_stlex, in direct analogy with the versions with no implicit barrier. rdar://problem/15885451 llvm-svn: 212175
* X86: inline all atomic operations up to 128-bits.Tim Northover2014-07-021-0/+29
| | | | | | | | | | The backend *can* cope with all of these now, so Clang should give it the chance. On CPUs without cmpxchg16b (e.g. the original athlon64) LLVM can reform the libcalls. rdar://problem/13496295 llvm-svn: 212173
* Added test for capturing VLA types if the captured variable is a function ↵Alexey Bataev2014-07-021-0/+13
| | | | | | parameter. llvm-svn: 212170
* Enable test/CodeGen/indirect-goto.c in 64b for local arraysGerolf Hoflehner2014-07-011-3/+2
| | | | | | | | | | | | | In 32b mode the reference count for block addresses is not zero. This prevents inlining and constant folding and causes the test to fail. Changing the triple allows runnning the test in 64b mode. The array in foo2 is now local instead of static until at lower optimization levels the interprocedural constant propagator is invoked before the global optimizer. llvm-svn: 212092
* Temporarily disable the indirect-goto.c test.Bob Wilson2014-07-011-1/+2
| | | | | | | llvm r212077 causes this test to fail. We need to reorder some passes and possibly make other changes to reenable the optimization being tested here. llvm-svn: 212091
* [x86] Add Clang support for intrinsic __rdpmc.Andrea Di Biagio2014-06-301-0/+1
| | | | | | | | | | | | This patch adds intrinsic __rdpmc to header file 'ia32intrin.h'. Intrinsic __rdmpc can be used to read performance monitoring counters. It is implemented as a direct call to __builtin_ia32_rdpmc. It takes as input a value representing the index of the performance counter to read. The value of the performance counter is then returned as a unsigned 64-bit quantity. llvm-svn: 212053
* Second part of fix in CodeGen/captured-statements-nested.cAlexey Bataev2014-06-301-1/+1
| | | | llvm-svn: 212028
* Test fixAlexey Bataev2014-06-301-4/+4
| | | | llvm-svn: 212026
* Fixed incompatibility in CodeGen/captured-statements-nested.c with MSVCAlexey Bataev2014-06-301-1/+1
| | | | llvm-svn: 212025
* Fixed CodeGen/captured-statements-nested.c testAlexey Bataev2014-06-301-26/+23
| | | | llvm-svn: 212024
* Disable CodeGen/captured-statements-nested.cAlexey Bataev2014-06-301-0/+1
| | | | llvm-svn: 212018
* Fixed CodeGen/captured-statements-nested.c testAlexey Bataev2014-06-301-20/+19
| | | | llvm-svn: 212016
* Disable CodeGen/captured-statements-nested.cAlexey Bataev2014-06-301-1/+1
| | | | llvm-svn: 212014
* Temp XFAIL CodeGen/captured-statements-nested.c to fix the testAlexey Bataev2014-06-301-0/+1
| | | | llvm-svn: 212013
* Using of variable length arrays in captured statements and OpenMP constructs.Alexey Bataev2014-06-302-6/+33
| | | | | | Differential Revision: http://reviews.llvm.org/D4067 llvm-svn: 212010
* Remove some incorrect test suppressionsAlp Toker2014-06-304-4/+0
| | | | | | | | | These don't actually require any registered backend to run. This commit tests the water with a handful of fixes for what is a more widespread problem. llvm-svn: 212008
* Basic: fix handling for Windows Itanium environmentSaleem Abdulrasool2014-06-281-0/+15
| | | | | | | This corrects the handling for i686-windows-itanium. This environment is nearly identical to Windows MSVC, except it uses the itanium ABI for C++. llvm-svn: 211991
OpenPOWER on IntegriCloud