summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix for arm bots afternew PM pass port. Prevent cross compiling on arm.Leonard Chan2018-10-171-1/+1
| | | | llvm-svn: 344702
* Fix for failing unit tests on some bots after r344696.Leonard Chan2018-10-171-23/+2
| | | | llvm-svn: 344701
* [PassManager/Sanitizer] Enable usage of ported AddressSanitizer passes with ↵Leonard Chan2018-10-171-0/+31
| | | | | | | | | | | | | -fsanitize=address Enable usage of `AddressSanitizer` and `AddressModuleSanitizer` ported from the legacy to the new PassManager. This patch depends on https://reviews.llvm.org/D52739. Differential Revision: https://reviews.llvm.org/D52814 llvm-svn: 344699
* [driver][mips] Support MIPS R6 target triplesSimon Atanasyan2018-10-164-0/+48
| | | | | | | | | | | | | | | | This change adds support for the following MIPS target triples: mipsisa32r6-linux-gnu mipsisa32r6el-linux-gnu mipsisa64r6-linux-gnuabi64 mipsisa64r6el-linux-gnuabi64 mipsisa64r6-linux-gnuabin32 mipsisa64r6el-linux-gnuabin32 Patch by Yun Qiang Su. Differential revision: https://reviews.llvm.org/D50850 llvm-svn: 344608
* [mips] Group similar commands in the test case. NFCSimon Atanasyan2018-10-161-8/+4
| | | | llvm-svn: 344583
* [mips] Fix handling of GNUABIN32 environment in a target tripleSimon Atanasyan2018-10-154-0/+25
| | | | | | | | | | | | The `GNUABIN32` environment in a target triple implies using the N32 ABI. This patch adds support for this environment and switches on N32 ABI if necessary. Patch by Patch by YunQiang Su. Differential revision: https://reviews.llvm.org/D51464 llvm-svn: 344570
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-8/+8
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [clang][ubsan] Split Implicit Integer Truncation Sanitizer into unsigned and ↵Roman Lebedev2018-10-118-41/+371
| | | | | | | | | | | | | | | | | | | | signed checks Summary: As per IRC disscussion, it seems we really want to have more fine-grained `-fsanitize=implicit-integer-truncation`: * A check when both of the types are unsigned. * Another check for the other cases (either one of the types is signed, or both of the types is signed). This is clang part. Compiler-rt part is D50902. Reviewers: rsmith, vsk, Sanitizers Reviewed by: rsmith Differential Revision: https://reviews.llvm.org/D50901 llvm-svn: 344230
* [WebAssembly] Saturating float-to-int builtinsThomas Lively2018-10-111-0/+72
| | | | | | | | | | | | Summary: Depends on D53007 and D53004. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D53009 llvm-svn: 344205
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-8/+8
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* [WebAssembly][NFC] Rename test functions for builtinsThomas Lively2018-10-091-45/+45
| | | | | | | | | | Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, jfb, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D53007 llvm-svn: 344009
* [COFF, ARM64] Add _InterlockedAdd intrinsicMandeep Singh Grang2018-10-051-0/+10
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma Reviewed By: efriedma Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52811 llvm-svn: 343894
* [llvm-nm] Write "no symbol" output to stderrPetr Hosek2018-10-051-1/+1
| | | | | | | | | | This matches the output of binutils' nm and ensures that any scripts or tools that use nm and expect empty output in case there no symbols don't break. Differential Revision: https://reviews.llvm.org/D52943 llvm-svn: 343887
* [COFF, ARM64] Add _InterlockedCompareExchangePointer_nf intrinsicMandeep Singh Grang2018-10-051-0/+15
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, efriedma Reviewed By: efriedma Subscribers: efriedma, kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52807 llvm-svn: 343881
* [AArch64] Use filecheck captures for metadata node numbers in test. NFCDavid Green2018-10-051-4/+4
| | | | | | Just a quick fix for cases where extra metadata members are present. llvm-svn: 343843
* [WebAssembly] abs and sqrt builtinsThomas Lively2018-10-051-0/+24
| | | | | | | | | | | | Summary: Depends on D52910. Reviewers: aheejin, dschuff, craig.topper Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52913 llvm-svn: 343838
* [WebAssembly] any_true and all_true builtinsThomas Lively2018-10-051-0/+48
| | | | | | | | | | | | Summary: Depends on D52858. Reviewers: aheejin, dschuff, craig.topper Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52910 llvm-svn: 343837
* [WebAssembly] saturating arithmetic builtinsThomas Lively2018-10-051-0/+56
| | | | | | | | | | | | Summary: Depends on D52856. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52858 llvm-svn: 343836
* [WebAssembly] __builtin_wasm_replace_lane_* builtinsThomas Lively2018-10-051-0/+38
| | | | | | | | | | | | Summary: Depends on D52852. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52856 llvm-svn: 343835
* [WebAssembly] __builtin_wasm_extract_lane_* builtinsThomas Lively2018-10-051-4/+70
| | | | | | | | | | Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D52852 llvm-svn: 343834
* [COFF, ARM64] Add __getReg intrinsicMandeep Singh Grang2018-10-041-0/+12
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar, efriedma Reviewed By: efriedma Subscribers: peter.smith, efriedma, kristof.beyls, chrib, cfe-commits Differential Revision: https://reviews.llvm.org/D52838 llvm-svn: 343824
* [constexpr] Fix ICE when memcpy() is given a pointer to an incomplete arrayPetr Pavlu2018-10-041-0/+7
| | | | | | | | | | Fix code for constant evaluation of __builtin_memcpy() and __builtin_memmove() that would attempt to divide by zero when given two pointers to an incomplete array. Differential Revision: https://reviews.llvm.org/D51855 llvm-svn: 343761
* [llvm-nm] Update clang tests based on changed llvm-nm outputJordan Rupprecht2018-10-031-1/+2
| | | | llvm-svn: 343744
* [COFF, ARM64] Add _ReadWriteBarrier intrinsicMandeep Singh Grang2018-10-031-0/+7
| | | | | | | | | | | | Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar Reviewed By: rnk Subscribers: kristof.beyls, chrib, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D52809 llvm-svn: 343699
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-10-014-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | from those that aren't. This patch changes the way __block variables that aren't captured by escaping blocks are handled: - Since non-escaping blocks on the stack never get copied to the heap (see https://reviews.llvm.org/D49303), Sema shouldn't error out when the type of a non-escaping __block variable doesn't have an accessible copy constructor. - IRGen doesn't have to use the specialized byref structure (see https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a non-escaping __block variable anymore. Instead IRGen can emit the variable as a normal variable and copy the reference to the block literal. Byref copy/dispose helpers aren't needed either. This reapplies r343518 after fixing a use-after-free bug in function Sema::ActOnBlockStmtExpr where the BlockScopeInfo was dereferenced after it was popped and deleted. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 343542
* Revert r343518.Akira Hatanaka2018-10-014-7/+0
| | | | | | | | | Bots are still failing. http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/24420 http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/12958 llvm-svn: 343531
* Distinguish `__block` variables that are captured by escaping blocksAkira Hatanaka2018-10-014-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from those that aren't. This patch changes the way __block variables that aren't captured by escaping blocks are handled: - Since non-escaping blocks on the stack never get copied to the heap (see https://reviews.llvm.org/D49303), Sema shouldn't error out when the type of a non-escaping __block variable doesn't have an accessible copy constructor. - IRGen doesn't have to use the specialized byref structure (see https://clang.llvm.org/docs/Block-ABI-Apple.html#id8) for a non-escaping __block variable anymore. Instead IRGen can emit the variable as a normal variable and copy the reference to the block literal. Byref copy/dispose helpers aren't needed either. This reapplies r341754, which was reverted in r341757 because it broke a couple of bots. r341754 was calling markEscapingByrefs after the call to PopFunctionScopeInfo, which caused the popped function scope to be cleared out when the following code was compiled, for example: $ cat test.m struct A { id data[10]; }; void foo() { __block A v; ^{ (void)v; }; } This commit calls markEscapingByrefs before calling PopFunctionScopeInfo to prevent that from happening. rdar://problem/39352313 Differential Revision: https://reviews.llvm.org/D51564 llvm-svn: 343518
* [X86] Add more of the icc unaligned load/store to/from 128 bit vector intrinsicsCraig Topper2018-09-291-0/+48
| | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds _mm_loadu_si32 _mm_loadu_si16 _mm_storeu_si64 _mm_storeu_si32 _mm_storeu_si16 We already had _mm_load_si64. Reviewers: spatel, RKSimon Reviewed By: RKSimon Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52665 llvm-svn: 343388
* [X86] Add the movbe instruction intrinsics from icc.Craig Topper2018-09-281-0/+49
| | | | | | | | | | These intrinsics exist in icc. They can be found on the Intel Intrinsics Guide website. All the backend support is in place to pattern match a load+bswap or a bswap+store pattern to the MOVBE instructions. So we just need to get the frontend to emit the correct IR. The pointer arguments in icc are declared as void so I had to jump through a packed struct to forcing a specific alignment on the load/store. Same trick we use in the unaligned vector load/store intrinsics Differential Revision: https://reviews.llvm.org/D52586 llvm-svn: 343343
* [clang][ubsan][NFC] Slight test cleanup in preparation for D50901Roman Lebedev2018-09-274-80/+73
| | | | | | | | | | | | Reviewers: vsk, vitalybuka, filcab Reviewed By: vitalybuka Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52589 llvm-svn: 343251
* Revert "[DebugInfo] Generate debug information for labels."Vitaly Buka2018-09-272-44/+0
| | | | | | | | This reverts commit r343148. It crashes on sanitizer-x86_64-linux-autoconf. llvm-svn: 343183
* [DebugInfo] Generate debug information for labels.Hsiangkai Wang2018-09-262-0/+44
| | | | | | | | | | | | | | Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadata with the label. After fixing PR37395. After fixing problems in LiveDebugVariables. After fixing NULL symbol problems in AddressPool when enabling split-dwarf-file. Differential Revision: https://reviews.llvm.org/D45045 llvm-svn: 343148
* [X86] For lzcnt/tzcnt intrinsics use cttz/ctlz intrinsics with zero_undef ↵Craig Topper2018-09-262-23/+13
| | | | | | | | | | | | flag set to false. Previously we used a select and the zero_undef=true intrinsic. In -O2 this pattern will get optimized to zero_undef=false. But in -O0 this optimization won't happen. This results in a compare and cmov being wrapped around a tzcnt/lzcnt instruction. By using the zero_undef=false intrinsic directly without the select, we can improve the -O0 codegen to just an lzcnt/tzcnt instruction. Differential Revision: https://reviews.llvm.org/D52392 llvm-svn: 343126
* [clang-check-codegen][cfstring] Accept either @ or % for progbits to make ↵Kristina Brooks2018-09-251-1/+1
| | | | | | | | | | | | | | | | | ppc64be bots happy. PPC64BE bots use % instead of @ for directives like progbits. Since CFString tests also check asm output, they fail on the following: cfstring3.c:44:19: error: CHECK-ASM-ELF: expected string not found in input // CHECK-ASM-ELF: .section cfstring,"aw",@progbits <stdin>:30:2: note: possible intended match here .section cfstring,"aw",%progbits Updating that check with a {{[@%]}}progbits regex to make those bots happy. llvm-svn: 343044
* Reland "[Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with ↵Kristina Brooks2018-09-253-17/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `-fconstant-cfstrings`" Relanding rL342883 with more fragmented tests to test ELF-specific section emission separately from broad-scope CFString tests. Now this tests the following separately 1). CoreFoundation builds and linkage for ELF while building it. 2). CFString ELF section emission outside CF in assembly output. 3). Broad scope `cfstring3.c` tests which cover all object formats at bitcode level and assembly level (including ELF). This fixes non-bridged CoreFoundation builds on ELF targets that use -fconstant-cfstrings. The original changes from differential for a similar patch to PE/COFF (https://reviews.llvm.org/D44491) did not check for an edge case where the global could be a constant which surfaced as an issue when building for ELF because of different linkage semantics. This patch addresses several issues with crashes related to CF builds on ELF as well as improves data layout by ensuring string literals that back the actual CFConstStrings end up in .rodata in line with Mach-O. Change itself tested with CoreFoundation on Linux x86_64 but should be valid for BSD-like systems as well that use ELF as the native object format. Differential Revision: https://reviews.llvm.org/D52344 llvm-svn: 343038
* [CodeGen] Revert commit https://reviews.llvm.org/rL342717Calixte Denizet2018-09-241-5/+4
| | | | llvm-svn: 342912
* [Power9] [CLANG] Add __float128 exponent GET and SET builtinsStefan Pintilie2018-09-241-0/+12
| | | | | | | | | | | | | Added __builtin_vsx_scalar_extract_expq __builtin_vsx_scalar_insert_exp_qp Builtins should behave the same way as in GCC. Differential Revision: https://reviews.llvm.org/D48184 llvm-svn: 342911
* Revert "rL342883: [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with ↵Kristina Brooks2018-09-242-36/+2
| | | | | | | | `-fconstant-cfstrings`." Seems to be causing buildbot failures, need to look into it. llvm-svn: 342893
* [CFString][ELF] Fix a missed test causing buildbot failures from 342883.Kristina Brooks2018-09-241-2/+2
| | | | | | Accidetanlly forgot to update it, big sorry. llvm-svn: 342890
* [Clang][CodeGen][ObjC]: Fix CoreFoundation on ELF with `-fconstant-cfstrings`.Kristina Brooks2018-09-241-0/+34
| | | | | | | | | | | | | | | | | | | [Clang][CodeGen][ObjC]: Fix non-bridged CoreFoundation builds on ELF targets that use `-fconstant-cfstrings`. The original changes from differential for a similar patch to PE/COFF (https://reviews.llvm.org/D44491) did not check for an edge case where the global could be a constant which surfaced as an issue when building for ELF because of different linkage semantics. This patch addresses several issues with crashes related to CF builds on ELF as well as improves data layout by ensuring string literals that back the actual CFConstStrings end up in .rodata in line with Mach-O. Change itself tested with CoreFoundation on Linux x86_64 but should be valid for BSD-like systems as well that use ELF as the native object format. Differential Revision: https://reviews.llvm.org/D52344 llvm-svn: 342883
* Fix codemodels.c test case (only test mcmodel=medium on X86).Caroline Tice2018-09-221-1/+1
| | | | | | | | | aarch64 testing is broken because "medium" is not a valid code-model on aarch64, and codemodels.c tests that. This fixes that problem by adding "-triple x86_64-unknown-linux-gnu" to the test with "-mcode-model moedium". llvm-svn: 342812
* Fix codemodels.c test case (only test mcmodel-kernel on x86)Caroline Tice2018-09-211-1/+1
| | | | | | | | | | | | A recent commit I made broke aarch64 testing, because "kernel" apparently is not a valid code-model on aarch64, and one of my tests tested that. This fixes the problem (hopefully) by adding "-triple x86_64-unknown-linux-gnu" to the test build with "-mcodel-model kernel". Differential Revision: https://reviews.llvm.org/D52383 llvm-svn: 342789
* Add necessary support for storing code-model to module IR.Caroline Tice2018-09-211-0/+18
| | | | | | | | | | | | Currently the code-model does not get saved in the module IR, so if a code model is specified when compiling with LTO, it gets lost and is not propagated properly to LTO. This patch does what is necessary in the front end to pass the code-model to the module, so that the back end can store it in the Module . Differential Revision: https://reviews.llvm.org/D52323 llvm-svn: 342758
* [CodeGen] Add to emitted DebugLoc information about coverage when it's requiredCalixte Denizet2018-09-211-4/+5
| | | | | | | | | | | | | | | | | | | | Summary: Some lines have a hit counter where they should not have one. Cleanup stuff is located to the last line of the body which is most of the time a '}'. And Exception stuff is added at the beginning of a function and at the end (represented by '{' and '}'). So in such cases, the DebugLoc used in GCOVProfiling.cpp must be marked as not covered. This patch is a followup of https://reviews.llvm.org/D49915. Tests in projects/compiler_rt are fixed by: https://reviews.llvm.org/D49917 Reviewers: marco-c, davidxl Reviewed By: marco-c Subscribers: dblaikie, cfe-commits, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D49916 llvm-svn: 342717
* [PowerPC] [Clang] Add vector int128 pack/unpack builtinsQingShan Zhang2018-09-203-0/+43
| | | | | | | | | | | | unsigned long long builtin_unpack_vector_int128 (vector int128_t, int); vector int128_t builtin_pack_vector_int128 (unsigned long long, unsigned long long); Builtins should behave the same way as in GCC. Patch By: wuzish (Zixuan Wu) Differential Revision: https://reviews.llvm.org/D52074 llvm-svn: 342614
* [clang-cl] Fix PR38934: failing to dllexport class template member w/ ↵Hans Wennborg2018-09-141-0/+12
| | | | | | | | | | | | explicit instantiation and PCH The code in ASTContext::DeclMustBeEmitted was supposed to handle this, but didn't take into account that synthesized members such as operator= might not get marked as template specializations, because they're synthesized on the instantiation directly when handling the class-level dllexport attribute. llvm-svn: 342240
* [XRay][clang] Emit "never-instrument" attributeDean Michael Berris2018-09-142-7/+43
| | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, we only emit the XRay attributes in LLVM IR when the -fxray-instrument flag is provided. This may cause issues with thinlto when the final binary is being built/linked with -fxray-instrument, and the constitutent LLVM IR gets re-lowered with xray instrumentation. With this change, we can honour the "never-instrument "attributes provided in the source code and preserve those in the IR. This way, even in thinlto builds, we retain the attributes which say whether functions should never be XRay instrumented. This change addresses llvm.org/PR38922. Reviewers: mboerger, eizan Subscribers: mehdi_amini, dexonsmith, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D52015 llvm-svn: 342200
* [CodeGen][ARM] Coerce FP16 vectors to integer vectors when neededMikhail Maltsev2018-09-122-121/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: On targets that do not support FP16 natively LLVM currently legalizes vectors of FP16 values by scalarizing them and promoting to FP32. This causes problems for the following code: void foo(int, ...); typedef __attribute__((neon_vector_type(4))) __fp16 float16x4_t; void bar(float16x4_t x) { foo(42, x); } According to the AAPCS (appendix A.2) float16x4_t is a containerized vector fundamental type, so 'foo' expects that the 4 16-bit FP values are packed into 2 32-bit registers, but instead bar promotes them to 4 single precision values. Since we already handle scalar FP16 values in the frontend by bitcasting them to/from integers, this patch adds similar handling for vector types and homogeneous FP16 vector aggregates. One existing test required some adjustments because we now generate more bitcasts (so the patch changes the test to target a machine with native FP16 support). Reviewers: eli.friedman, olista01, SjoerdMeijer, javed.absar, efriedma Reviewed By: javed.absar, efriedma Subscribers: efriedma, kristof.beyls, cfe-commits, chrib Differential Revision: https://reviews.llvm.org/D50507 llvm-svn: 342034
* [gcov] Update a clang test for r341977Vedant Kumar2018-09-111-2/+1
| | | | | | | | | | Update test/CodeGen/code-coverage.c so that it doesn't refer to a gcov function which is no longer emitted after r341977. Fixes bot failure: http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/23831 llvm-svn: 341985
* Fix test regression in r341862Erich Keane2018-09-101-1/+1
| | | | | | | The commit updates when AES is enabled, but failed to update the tests. This patch fixes them. llvm-svn: 341871
OpenPOWER on IntegriCloud