summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [InstCombine] don't assume 'inbounds' for bitcast pointer to GEP transform ↵Sanjay Patel2019-10-061-36/+36
| | | | | | | | | | | | (PR43501) https://bugs.llvm.org/show_bug.cgi?id=43501 We can't declare a GEP 'inbounds' in general. But we may salvage that information if we have known dereferenceable bytes on the source pointer. Differential Revision: https://reviews.llvm.org/D68244 llvm-svn: 373847
* [clang] Prevent false positives in arm-mfpu-none codegen test.Simon Tatham2019-10-041-0/+1
| | | | | | | | | | | | | | | | | A user pointed out to me in private email that this test will fail if it sees the letter 's' followed by a digit in any part of clang's assembly output after the function label. That includes the .ident at the end, which can include a full pathname or hostname or both from the system clang was built on. So if that path or hostname includes any text like 's5' then it will cause the test to fail. Fixed by adding a check for `.fnend`, to limit the scope of the `CHECK-NOT` to only the actual generated code for the test function. (Committed without prior review on the basis that it's a simple and obvious pure test-suite fix and also in a test I contributed myself.) llvm-svn: 373744
* [clang] [AST] Treat "inline gnu_inline" the same way as "extern inline ↵Martin Storsjo2019-09-271-1/+2
| | | | | | | | | | | | | | | | | gnu_inline" in C++ mode This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl. GCC documents the gnu_inline attribute with "In C++, this attribute does not depend on extern in any way, but it still requires the inline keyword to enable its special behavior." The previous behaviour of gnu_inline in C++, without the extern keyword, can be traced back to the original commit that added support for gnu_inline, SVN r69045. Differential Revision: https://reviews.llvm.org/D67414 llvm-svn: 373078
* [test] Use %clang_cc1 instead of %clang -cc1Fangrui Song2019-09-271-1/+1
| | | | llvm-svn: 373043
* [x86] Adding support for some missing intrinsics: _castf32_u32, ↵Pengfei Wang2019-09-251-0/+45
| | | | | | | | | | | | | | | | | | | | _castf64_u64, _castu32_f32, _castu64_f64 Summary: Adding support for some missing intrinsics: _castf32_u32, _castf64_u64, _castu32_f32, _castu64_f64 Reviewers: craig.topper, LuoYuanke, RKSimon, pengfei Reviewed By: RKSimon Subscribers: llvm-commits Patch by yubing (Bing Yu) Differential Revision: https://reviews.llvm.org/D67212 llvm-svn: 372802
* [CLANG][BPF] permit any argument type for __builtin_preserve_access_index()Yonghong Song2019-09-221-0/+18
| | | | | | | | | | | | | | | | | | | | Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index() signature") changed the builtin function signature to PointerT __builtin_preserve_access_index(PointerT ptr) with a pointer type as the argument/return type, where argument and return types must be the same. There is really no reason for this constraint. The builtin just presented a code region so that IR builtins __builtin_{array, struct, union}_preserve_access_index can be applied. This patch removed the pointer type restriction to permit any argument type as long as it is permitted by the compiler. Differential Revision: https://reviews.llvm.org/D67883 llvm-svn: 372516
* [SystemZ] Support z15 processor nameUlrich Weigand2019-09-207-5/+11
| | | | | | | | | | The recently announced IBM z15 processor implements the architecture already supported as "arch13" in LLVM. This patch adds support for "z15" as an alternate architecture name for arch13. Corrsponding LLVM support was committed as rev. 372435. llvm-svn: 372436
* [X86] Prevent assertion when calling a function that returns double with ↵Craig Topper2019-09-181-0/+20
| | | | | | | | -mno-sse2 on x86-64. As seen in the most recent updates to PR10498 llvm-svn: 372197
* [ARM] Update clang for removal of vfp2d16 and vfp2d16spEli Friedman2019-09-171-14/+14
| | | | | | | | Matching fix for https://reviews.llvm.org/D67375 (r372186). Differential Revision: https://reviews.llvm.org/D67467 llvm-svn: 372187
* [NFC] Updated testDavid Bolvansky2019-09-171-7/+7
| | | | llvm-svn: 372095
* Fix reliance on -flax-vector-conversions in AVX intrinsics headers andRichard Smith2019-09-173-14/+14
| | | | | | corresponding tests. llvm-svn: 372063
* Fix reliance on lax vector conversions in tests for x86 intrinsics.Richard Smith2019-09-176-13/+13
| | | | llvm-svn: 372062
* Remove reliance on lax vector conversions from altivec.h in VSX mode.Richard Smith2019-09-174-4/+21
| | | | llvm-svn: 372061
* [Clang][Codegen] Disable arm_acle.c test.Roman Lebedev2019-09-161-0/+2
| | | | | | | | | | This test is broken by design. Clang codegen tests should not depend on llvm middle-end behaviour, they should *only* test clang codegen. Yet this test runs whole optimization pipeline. I've really tried to fix it, but there isn't just a few things that depend on passes, but everything there does. llvm-svn: 372015
* [Clang][Codegen] Relax available-externally-suppress.c testRoman Lebedev2019-09-161-2/+0
| | | | | | | | | That test is broken by design. It depends on llvm middle-end behavior. No clang codegen test should be doing that. This one is salvageable by relaxing check lines. llvm-svn: 372014
* Change signature of __builtin_rotateright64 back to unsignedKarl-Johan Karlsson2019-09-161-0/+4
| | | | | | | | | | | | | | | | The signature of __builtin_rotateright64 was by misstake changed from unsigned to signed in r360863, this patch will change it back to unsigned as intended. This fixes pr43309 Reviewers: efriedma, hans Reviewed By: hans Differential Revision: https://reviews.llvm.org/D67606 llvm-svn: 371969
* [WebAssembly] Narrowing and widening SIMD opsThomas Lively2019-09-131-0/+76
| | | | | | | | | | | | | | | | Summary: Implements target-specific LLVM intrinsics and clang builtins for these new SIMD operations, as described at https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#integer-to-integer-narrowing. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67425 llvm-svn: 371906
* For PR17164: split -fno-lax-vector-conversion into three differentRichard Smith2019-09-1311-18/+18
| | | | | | | | | | | | | | | | | | | | | levels: -- none: no lax vector conversions [new GCC default] -- integer: only conversions between integer vectors [old GCC default] -- all: all conversions between same-size vectors [Clang default] For now, Clang still defaults to "all" mode, but per my proposal on cfe-dev (2019-04-10) the default will be changed to "integer" as soon as that doesn't break lots of testcases. (Eventually I'd like to change the default to "none" to match GCC and general sanity.) Following GCC's behavior, the driver flag -flax-vector-conversions is translated to -flax-vector-conversions=integer. This reinstates r371805, reverted in r371813, with an additional fix for lldb. llvm-svn: 371817
* Fix interaction between r371813 and r371814.Richard Smith2019-09-131-3/+3
| | | | llvm-svn: 371816
* Remove reliance on lax vector conversions from altivec.h and its test.Richard Smith2019-09-131-13/+13
| | | | llvm-svn: 371814
* Revert "For PR17164: split -fno-lax-vector-conversion into three different"Jonas Devlieghere2019-09-1310-15/+15
| | | | | | | This breaks the LLDB build. I tried reaching out to Richard, but haven't gotten a reply yet. llvm-svn: 371813
* For PR17164: split -fno-lax-vector-conversion into three differentRichard Smith2019-09-1310-15/+15
| | | | | | | | | | | | | | | | | | levels: -- none: no lax vector conversions [new GCC default] -- integer: only conversions between integer vectors [old GCC default] -- all: all conversions between same-size vectors [Clang default] For now, Clang still defaults to "all" mode, but per my proposal on cfe-dev (2019-04-10) the default will be changed to "integer" as soon as that doesn't break lots of testcases. (Eventually I'd like to change the default to "none" to match GCC and general sanity.) Following GCC's behavior, the driver flag -flax-vector-conversions is translated to -flax-vector-conversions=integer. llvm-svn: 371805
* Improve code generation for thread_local variables:Richard Smith2019-09-121-11/+0
| | | | | | | | | | | | | | | | | | | | | Summary: * Don't bother using a thread wrapper when the variable is known to have constant initialization. * Emit the thread wrapper as discardable-if-unused in TUs that don't contain a definition of the thread_local variable. * Don't emit the thread wrapper at all if the thread_local variable is unused and discardable; it will be emitted by all TUs that need it. Reviewers: rjmccall, jdoerfert Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67429 llvm-svn: 371767
* [Clang][CodeGen] support alias attribute w/ gnu_inlineNick Desaulniers2019-09-121-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: r369705 did not consider the addition of gnu_inline on function declarations of alias attributed functions. This resulted in a reported regression in the clang-9-rc4 release from the Zig developers building glibc, which was observable as a failed assertion: llvm-project/clang/lib/AST/Decl.cpp:3336: bool clang::FunctionDecl::isInlineDefinitionExternallyVisible() const: Assertion `(doesThisDeclarationHaveABody() || willHaveBody()) && "Must be a function definition"' failed. Alias function declarations do not have bodies, so allow us to proceed if we have the alias function attribute but no body/definition, and add a test case. The emitted symbols and their linkage matches GCC for the added test case. Link: https://bugs.llvm.org/show_bug.cgi?id=43268 Reviewers: aaron.ballman, rsmith, erichkeane, andrewrk Reviewed By: andrewrk Subscribers: cfe-commits, andrewrk, hans, srhines Tags: #clang Differential Revision: https://reviews.llvm.org/D67455 llvm-svn: 371766
* [CodeGen] Add alias for cpu_dispatch function with IFunc & Fix resolver ↵Fangrui Song2019-09-114-45/+61
| | | | | | | | | | | | | | linkage type Multi-versioned functions defined by cpu_dispatch and implemented with IFunc can not be called outside the translation units where they are defined due to lack of symbols. This patch add function aliases for these functions and thus make them visible outside. Differential Revision: https://reviews.llvm.org/D67058 Patch by Senran Zhang llvm-svn: 371586
* Reland "Change the X86 datalayout to add three address spacesAmy Huang2019-09-1014-21/+20
| | | | | | | | | | for 32 bit signed, 32 bit unsigned, and 64 bit pointers." This reverts 57076d3199fc2b0af4a3736b7749dd5462cacda5. Original review at https://reviews.llvm.org/D64931. Review for added fix at https://reviews.llvm.org/D66843. llvm-svn: 371568
* Re-land Remove REQUIRES:shell from tests that pass for me on WindowsReid Kleckner2019-09-101-4/+7
| | | | | | | | | | | | This reverts r371497 (git commit 3d7e9ab7b9f8c53aa41420c54970f0fb421004a2) Reorder `not` with `env` in these two tests so they pass: Driver/rewrite-map-in-diagnostics.c Index/crash-recovery-modules.m. This will not be necessary after D66531 lands. llvm-svn: 371552
* Revert Remove REQUIRES:shell from tests that pass for me on WindowsJames Henderson2019-09-101-7/+4
| | | | | | This reverts r371478 (git commit a9980f60ce083fa6d5fd03c12c58ca0b293e3d60) llvm-svn: 371497
* Remove REQUIRES:shell from tests that pass for me on WindowsReid Kleckner2019-09-101-4/+7
| | | | | | | | | | | | | I see in the history for some of these tests REQUIRES:shell was used as a way to disable tests on Windows because they are flaky there. I tried not to re-enable such tests, but it's possible that I missed some and this will re-enable flaky tests on Windows. If so, we should disable them with UNSUPPORTED:system-windows and add a comment that they are flaky there. So far as I can tell, the lit internal shell is capable of running all of these tests, and we shouldn't use REQUIRES:shell as a proxy for Windows. llvm-svn: 371478
* [NFC] Add aacps bitfields access testDiogo N. Sampaio2019-09-091-0/+824
| | | | llvm-svn: 371410
* [X86] Prevent passing vectors of __int128 as <X x i128> in llvm IRCraig Topper2019-09-061-3/+6
| | | | | | | | | | | | | As far as I can tell, gcc passes 256/512 bit vectors __int128 in memory. And passes a vector of 1 _int128 in an xmm register. The backend considers <X x i128> as an illegal type and will scalarize any arguments with that type. So we need to coerce the argument types in the frontend to match to avoid the illegal type. I'm restricting this to change to Linux and NetBSD based on the how similar ABI changes have been handled in the past. PS4, FreeBSD, and Darwin are unaffected. I've also added a new -fclang-abi-compat version to restore the old behavior. This issue was identified in PR42607. Though even with the types changed, we still seem to be doing some unnecessary stack realignment. llvm-svn: 371169
* [X86] Pre-commit vector of __int128 test cases for D64672.Craig Topper2019-09-061-0/+49
| | | | llvm-svn: 371168
* [DebugInfo] Emit DW_TAG_enumeration_type for referenced global enumerator.Yuanfang Chen2019-09-041-1/+8
| | | | | | | | | | | | | | | | | This essentially reverts changes from r361400 while keeping behavior for CodeView. Reviewers: akhuang, rnk, probinson Reviewed by: rnk Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67141 llvm-svn: 370981
* [X86] Add support for avx512bf16 for __builtin_cpu_supports and ↵Craig Topper2019-09-041-0/+1
| | | | | | compiler-rt's cpu indicator. llvm-svn: 370915
* [PowerPC][Altivec][Clang] Check compile-time constant for vec_dst*Jinsong Ji2019-09-041-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is follow up of https://reviews.llvm.org/D66699. We might get ISEL ICE if we call vec_dss with non const 3rd arg. ``` Cannot select: intrinsic %llvm.ppc.altivec.dst ``` We should check the constraints in clang and generate better error messages. Reviewers: nemanjai, hfinkel, echristo, #powerpc, wuzish Reviewed By: #powerpc, wuzish Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66748 llvm-svn: 370912
* [PowerPC][Altivec] Fix constant argument for vec_dssJinsong Ji2019-09-042-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is similar to vec_ct* in https://reviews.llvm.org/rL304205. The argument must be a constant, otherwise instruction selection will fail. always_inline is not enough for isel to always fold everything away at -O0. The fix is to turn the function into macros in altivec.h. Fixes https://bugs.llvm.org/show_bug.cgi?id=43072 Reviewers: nemanjai, hfinkel, #powerpc, wuzish Reviewed By: #powerpc, wuzish Subscribers: wuzish, kbarton, MaskRay, shchenz, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66699 llvm-svn: 370902
* [x86] Fix bugs of some intrinsic functions in CLANG : _mm512_stream_ps, ↵Pengfei Wang2019-09-031-0/+17
| | | | | | | | | | | | | | | | _mm512_stream_pd, _mm512_stream_si512 Reviewers: craig.topper, pengfei, LuoYuanke, RKSimon, spatel Reviewed By: RKSimon Subscribers: llvm-commits Patch by Bing Yu (yubing) Differential Revision: https://reviews.llvm.org/D66786 llvm-svn: 370691
* [WebAssembly] Add SIMD QFMA/QFMSThomas Lively2019-08-311-0/+28
| | | | | | | | | | | | | | | | | | | Summary: Adds clang builtins and LLVM intrinsics for these experimental instructions. They are not implemented in engines yet, but that is ok because the user must opt into using them by calling the builtins. Reviewers: aheejin, dschuff Reviewed By: aheejin Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D67020 llvm-svn: 370556
* [CodeGen]: fix error message for "=r" asm constraintAlexander Potapenko2019-08-301-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Nico Weber reported that the following code: char buf[9]; asm("" : "=r" (buf)); yields the "impossible constraint in asm: can't store struct into a register" error message, although |buf| is not a struct (see http://crbug.com/999160). Make the error message more generic and add a test for it. Also make sure other tests in x86_64-PR42672.c check for the full error message. Reviewers: eli.friedman, thakis Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66948 llvm-svn: 370444
* [CodeGen]: don't treat structures returned in registers as memory inputsAlexander Potapenko2019-08-292-1/+103
| | | | | | | | | | | | | | | | | | | | Summary: The "=r" output constraint for a structure variable passed to inline asm shouldn't be converted to "=*r", as this changes the asm directive semantics and prevents DSE optimizations. Instead, preserve the constraints and return such structures as integers of corresponding size, which are converted back to structures when storing the result. Fixes PR42672. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65234 llvm-svn: 370335
* [x86] Adding support for some missing intrinsics: _mm512_cvtsi512_si32Pengfei Wang2019-08-291-0/+6
| | | | | | | | | | | | | | | | | | Summary: Adding support for some missing intrinsics: _mm512_cvtsi512_si32 Reviewers: craig.topper, pengfei, LuoYuanke, spatel, RKSimon Reviewed By: craig.topper Subscribers: llvm-commits Patch by Bing Yu (yubing) Differential Revision: https://reviews.llvm.org/D66785 llvm-svn: 370297
* Revert "Change the X86 datalayout to add three address spaces for 32 bit ↵Vlad Tsyrklevich2019-08-2814-20/+21
| | | | | | | | | signed," This reverts commit r370083 because it caused check-lld failures on sanitizer-x86_64-linux-fast. llvm-svn: 370142
* Change the X86 datalayout to add three address spaces for 32 bit signed,Amy Huang2019-08-2714-21/+20
| | | | | | 32 bit unsigned, and 64 bit pointers. llvm-svn: 370083
* [RISCV] Set MaxAtomicInlineWidth and MaxAtomicPromoteWidth for RV32/RV64 ↵Sam Elliott2019-08-271-0/+68
| | | | | | | | | | | | | | | | | | targets with atomics Summary: This ensures that libcalls aren't generated when the target supports atomics. Atomics aren't in the base RV32I/RV64I instruction sets, so MaxAtomicInlineWidth and MaxAtomicPromoteWidth are set only when the atomics extension is being targeted. This must be done in setMaxAtomicWidth, as this should be done after handleTargetFeatures has been called. Reviewers: jfb, jyknight, wmi, asb Reviewed By: asb Subscribers: pzheng, MaskRay, s.egerton, lenary, dexonsmith, psnobl, benna, Jim, JohnLLVM, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, jrtc27, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, lewis-revill, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57450 llvm-svn: 370073
* hwasan, codegen: Keep more lifetime markers used for hwasanVitaly Buka2019-08-261-0/+3
| | | | | | | | | | | | Reviewers: eugenis Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66697 llvm-svn: 369980
* msan, codegen, instcombine: Keep more lifetime markers used for msanVitaly Buka2019-08-261-0/+3
| | | | | | | | | | | | Reviewers: eugenis Subscribers: hiraditya, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D66695 llvm-svn: 369979
* NFC: Rename some sanitizer related lifetime checksVitaly Buka2019-08-241-5/+5
| | | | llvm-svn: 369830
* [Bugfix] fix r369705 unit testNick Desaulniers2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Aliases aren't supported on OSX. Add a GNU target triple. Reported-by: leonardchan Reported-by: erik.pilkington Reviewers: leonardchan, erik.pilkington Reviewed By: leonardchan, erik.pilkington Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66622 llvm-svn: 369713
* [Clang][CodeGen] set alias linkage on QualTypeNick Desaulniers2019-08-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: It seems that CodeGen was always using ExternalLinkage when emitting a GlobalDecl with __attribute__((alias)). This leads to symbol redefinitions (ODR) that cause failures at link time for static aliases. This is readily attempting to link an ARM (32b) allyesconfig Linux kernel built with Clang. Reported-by: nathanchance Suggested-by: ihalip Link: https://bugs.llvm.org/show_bug.cgi?id=42377 Link: https://github.com/ClangBuiltLinux/linux/issues/631 Reviewers: rsmith, aaron.ballman, erichkeane Reviewed By: aaron.ballman Subscribers: javed.absar, kristof.beyls, cfe-commits, srhines, ihalip, nathanchance Tags: #clang Differential Revision: https://reviews.llvm.org/D66492 llvm-svn: 369705
* [LTO] Always mark regular LTO units with EnableSplitLTOUnit=1 under the new ↵Leonard Chan2019-08-211-1/+2
| | | | | | | | | | | | pass manager Match the behavior of D65009 under the new pass manager. This addresses the test clang/test/CodeGen/split-lto-unit.c when running under the new PM. Differential Revision: https://reviews.llvm.org/D66488 llvm-svn: 369550
OpenPOWER on IntegriCloud