summaryrefslogtreecommitdiffstats
path: root/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
* Enable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper ↵Luo, Yuanke2019-05-062-0/+14
| | | | | | | | | | | | | | | | | | | | | | | Lake Summary: 1. Enable infrastructure of AVX512_BF16, which is supported for BFLOAT16 in Cooper Lake; 2. Enable intrinsics for VCVTNE2PS2BF16, VCVTNEPS2BF16 and DPBF16PS instructions, which are Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision. For more details about BF16 intrinsic, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference Patch by LiuTianle Reviewers: craig.topper, smaslov, LuoYuanke, wxiao3, annita.zhang, spatel, RKSimon Reviewed By: craig.topper Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60552 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@360018 91177308-0d34-0410-b5e6-96231b3b80d8
* [COFF, ARM64] Align global symbol by size for ARM64 MSVC ABITom Tan2019-05-023-1/+20
| | | | | | | | | | | | | | | | | | According to alignment section in below ARM64 ABI document, MSVC could increase alignment of global data based on its total size. Clang doesn't do this. Compile the same symbol into different alignments by Clang and MSVC could cause link error because some instruction encodings, like 64-bit LDR/STR with immediate, require the target to be 8 bytes aligned, and linker could choose code stream with such LDR/STR instruction from MSVC and 4 bytes aligned data from Clang into final image, which actually cannot be linked together (see https://bugs.llvm.org/show_bug.cgi?id=41506 for more details). https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=vs-2019#alignment Differential Revision: https://reviews.llvm.org/D61225 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359744 91177308-0d34-0410-b5e6-96231b3b80d8
* AMDGPU: Enable _Float16Yaxun Liu2019-04-301-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359594 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Initialize HasMTEVitaly Buka2019-04-271-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359366 91177308-0d34-0410-b5e6-96231b3b80d8
* [AArch64] Add support for MTE intrinsicsJaved Absar2019-04-262-0/+6
| | | | | | | | | | | | | | This provides intrinsics support for Memory Tagging Extension (MTE), which was introduced with the Armv8.5-a architecture. These intrinsics are available when __ARM_FEATURE_MEMORY_TAGGING is defined. Each intrinsic is described in detail in the ACLE Q1 2019 documentation: https://developer.arm.com/docs/101028/latest Reviewed By: Tim Nortover, David Spickett Differential Revision: https://reviews.llvm.org/D60485 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359348 91177308-0d34-0410-b5e6-96231b3b80d8
* [BPF] do not generate predefined macro bpfYonghong Song2019-04-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | "DefineStd(Builder, "bpf", Opts)" generates the following three macros: bpf __bpf __bpf__ and the macro "bpf" is due to the fact that the target language is C which allows GNU extensions. The name "bpf" could be easily used as variable name or type field name. For example, in current linux kernel, there are four places where bpf is used as a field name. If the corresponding types are included in bpf program, the compilation error will occur. This patch removed predefined macro "bpf" as well as "__bpf" which is rarely used if used at all. Signed-off-by: Yonghong Song <yhs@fb.com> Differential Revision: https://reviews.llvm.org/D61173 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359310 91177308-0d34-0410-b5e6-96231b3b80d8
* [CUDA] Implemented _[bi]mma* builtins.Artem Belevich2019-04-251-0/+2
| | | | | | | | | | | | | | | | These builtins provide access to the new integer and sub-integer variants of MMA (matrix multiply-accumulate) instructions provided by CUDA-10.x on sm_75 (AKA Turing) GPUs. Also added a feature for PTX 6.4. While Clang/LLVM does not generate any PTX instructions that need it, we still need to pass it through to ptxas in order to be able to compile code that uses the new 'mma' instruction as inline assembly (e.g used by NVIDIA's CUTLASS library https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101) Differential Revision: https://reviews.llvm.org/D60279 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359248 91177308-0d34-0410-b5e6-96231b3b80d8
* [Builtins] Implement __builtin_is_constant_evaluated for use in C++2aEric Fiselier2019-04-241-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements `__builtin_is_constant_evaluated` as specifier by [P0595R2](https://wg21.link/p0595r2). It is built on the back of Bill Wendling's work for `__builtin_constant_p()`. More tests to come, but early feedback is appreciated. I plan to implement warnings for common mis-usages like those belowe in a following patch: ``` void foo(int x) { if constexpr (std::is_constant_evaluated())) { // condition is always `true`. Should use plain `if` instead. foo_constexpr(x); } else { foo_runtime(x); } } ``` Reviewers: rsmith, MaskRay, bruno, void Reviewed By: rsmith Subscribers: dexonsmith, zoecarver, fdeazeve, kristina, cfe-commits Differential Revision: https://reviews.llvm.org/D55500 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359067 91177308-0d34-0410-b5e6-96231b3b80d8
* [FileSystemStatCache] Return std::error_code from stat cache methodsHarlan Haskins2019-04-162-23/+25
| | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we would return true/false signifying if the cache/lookup succeeded or failed. Instead, provide clients with the underlying error that was thrown while attempting to look up in the cache. Since clang::FileManager doesn't make use of this information, it discards the error that's received and casts away to bool. This change is NFC. Reviewers: benlangmuir, arphaman Subscribers: dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60735 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358509 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++20] Implement context-sensitive header-name lexing and pp-import parsing ↵Richard Smith2019-04-111-1/+1
| | | | | | in the preprocessor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358231 91177308-0d34-0410-b5e6-96231b3b80d8
* [AMDGPU] rename vi-insts into gfx8-instsStanislav Mekhanoshin2019-04-051-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D60293 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357792 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SourceManager::createFileID(UnownedTag, ...) take a const ↵Nico Weber2019-04-041-15/+17
| | | | | | | | | | | | | | | | | | | | | llvm::MemoryBuffer* Requires making the llvm::MemoryBuffer* stored by SourceManager const, which in turn requires making the accessors for that return const llvm::MemoryBuffer*s and updating all call sites. The original motivation for this was to use it and fix the TODO in CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag version of createFileID, and since llvm::SourceMgr* hands out a const llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO this way actually works, but this seems like a good change on its own anyways. No intended behavior change. Differential Revision: https://reviews.llvm.org/D60247 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357724 91177308-0d34-0410-b5e6-96231b3b80d8
* [WebAssembly] Add Emscripten OS definition + small_printfAlon Zakai2019-04-032-0/+19
| | | | | | | | | | | | | | | The Emscripten OS provides a definition of __EMSCRIPTEN__, and also that it supports iprintf optimizations. Also define small_printf optimizations, which is a printf with float support but not long double (which in wasm can be useful since long doubles are 128 bit and force linking of float128 emulation code). This part is based on sunfish's https://reviews.llvm.org/D57620 (which can't land yet since the WASI integration isn't ready yet). Differential Revision: https://reviews.llvm.org/D60167 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357552 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Wimplicit-fallthrough warning introduced in rL357466. NFCI.Simon Pilgrim2019-04-021-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357467 91177308-0d34-0410-b5e6-96231b3b80d8
* [PowerPC] Fix issue with inline asm - soft float modeStrahinja Petrovic2019-04-022-1/+12
| | | | | | | | | | This patch prevents floating point register constraints in soft float mode. Differential Revision: https://reviews.llvm.org/D59310 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357466 91177308-0d34-0410-b5e6-96231b3b80d8
* Range-style std::find{,_if} -> llvm::find{,_if}. NFCFangrui Song2019-03-314-20/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357359 91177308-0d34-0410-b5e6-96231b3b80d8
* [WebAssembly] Add mutable globals featureThomas Lively2019-03-292-0/+15
| | | | | | | | | | | | | | | | | | Summary: This feature is not actually used for anything in the WebAssembly backend, but adding it allows users to get it into the target features sections of their objects, which makes these objects future-compatible. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D60013 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357321 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP]Initial support for 'allocate' clause.Alexey Bataev2019-03-271-4/+2
| | | | | | Added parsing/sema analysis of the allocate clause. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357068 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Correct the value of MaxAtomicInlineWidth for pre-586 cpusCraig Topper2019-03-212-5/+18
| | | | | | | | | | Use the new cx8 feature flag that was added to the backend to represent support for cmpxchg8b. Use this flag to set the MaxAtomicInlineWidth. This also assumes all the cmpxchg instructions are enabled for CK_Generic which is what cc1 defaults to when nothing is specified. Differential Revision: https://reviews.llvm.org/D59566 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356709 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Use the CPUKind enum from PROC_ALIAS to directly get the CPUKind in ↵Craig Topper2019-03-211-3/+2
| | | | | | | | fillValidCPUList. We were using getCPUKind which translates the string to the enum also using PROC_ALIAS. This just cuts out the string compares. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356686 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Remove getCPUKindCanonicalName which is unused.Craig Topper2019-03-202-14/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D59578 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356580 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Separate PentiumPro and i686. They aren't aliases in the backend.Craig Topper2019-03-201-0/+2
| | | | | | | | | | PentiumPro has HasNOPL set in the backend. i686 does not. Despite having a function that looks like it canonicalizes alias names. It doesn't seem to be called. So I don't think this is a functional change. But its good to be consistent between the backend and frontend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356537 91177308-0d34-0410-b5e6-96231b3b80d8
* [AMDGPU] Add the missing clang change of the experimental buffer fat pointerMichael Liao2019-03-181-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356385 91177308-0d34-0410-b5e6-96231b3b80d8
* Reland the rest of "Add AIX Target Info"Jason Liu2019-03-144-1/+83
| | | | | | | | | llvm-svn 356197 relanded previously failing test case max_align.c. This commit will reland the rest of llvm-svn 356060 commit. Differential Revision: https://reviews.llvm.org/D59048 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356208 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Only define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 in 64-bit mode.Craig Topper2019-03-141-1/+1
| | | | | | | | | | | | | | | | | | | Summary: This define should correspond to CMPXCHG16B being available which requires 64-bit mode. I checked and gcc also seems to only define this in 64-bit mode. Reviewers: RKSimon, spatel, efriedma, jyknight, jfb Reviewed By: jfb Subscribers: jfb, cfe-commits, llvm-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59287 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356118 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add a new attribute, fortify_stdlib"Erik Pilkington2019-03-131-25/+0
| | | | | | | | | | This reverts commit r353765. After talking with our c stdlib folks, we decided to use the existing pass_object_size attribute to implement _FORTIFY_SOURCE wrappers, like Bionic does (I didn't realize that pass_object_size could be used for this purpose). Sorry for the flip/flop, and thanks to James Y. Knight for pointing this out to me. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356103 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Add AIX Target Info"Jason Liu2019-03-134-83/+1
| | | | | | | | | This reverts commit 4e192d0e1e72ce32fabf1bccc06ac31ab5385e78. The newly added test case max_align.c do not work on all platforms. original llvm-svn: 356060 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356070 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AIX Target InfoJason Liu2019-03-134-1/+83
| | | | | | | | | | | | | | | | | | Summary: A first pass over platform-specific properties of the C API/ABI on AIX for both 32-bit and 64-bit modes. This is a continuation of D18360 by Andrew Paprocki and further work by Wu Zhao. Patch by Andus Yu Reviewers: apaprocki, chandlerc, hubert.reinterpretcast, jasonliu, xingxue, sfertile Reviewed by: hubert.reinterpretcast, apaprocki, sfertile Differential Revision: https://reviews.llvm.org/D59048 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356060 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Remove 'cx16' from 'prescott' and 'yonah' as they are 32-bit only CPUs ↵Craig Topper2019-03-131-2/+3
| | | | | | and cmpxchg16b requires 64-bit mode. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@356008 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 5.0]Initial support for 'allocator' clause.Alexey Bataev2019-03-121-1/+12
| | | | | | | Added parsing/sema analysis/serialization/deserialization for the 'allocator' clause of the 'allocate' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355952 91177308-0d34-0410-b5e6-96231b3b80d8
* Modules: Rename MemoryBufferCache to InMemoryModuleCacheDuncan P. N. Exon Smith2019-03-092-48/+0
| | | | | | | | | | | | | Change MemoryBufferCache to InMemoryModuleCache, moving it from Basic to Serialization. Another patch will start using it to manage module build more explicitly, but this is split out because it's mostly mechanical. Because of the move to Serialization we can no longer abuse the Preprocessor to forward it to the ASTReader. Besides the rename and file move, that means Preprocessor::Preprocessor has one fewer parameter and ASTReader::ASTReader has one more. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355777 91177308-0d34-0410-b5e6-96231b3b80d8
* [IR][ARM] Add function pointer alignment to datalayoutMichael Platings2019-03-081-11/+12
| | | | | | | | | Use this feature to fix a bug on ARM where 4 byte alignment is incorrectly assumed. Differential Revision: https://reviews.llvm.org/D57335 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355685 91177308-0d34-0410-b5e6-96231b3b80d8
* Rollback of rL355585.Mitch Phillips2019-03-071-12/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces memory leak in FunctionTest.GetPointerAlignment that breaks sanitizer buildbots: ``` ================================================================= ==2453==ERROR: LeakSanitizer: detected memory leaks Direct leak of 128 byte(s) in 1 object(s) allocated from: #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105 #1 0x16936bc in llvm::User::operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/User.cpp:151:19 #2 0x7c3fe9 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:12 #3 0x7c3fe9 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136 #4 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc #5 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474 #6 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11 #7 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28 #8 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43 #9 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc #10 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257 #11 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46 #12 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50 #13 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) Indirect leak of 40 byte(s) in 1 object(s) allocated from: #0 0x610428 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:105 #1 0x151be6b in make_unique<llvm::ValueSymbolTable> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/ADT/STLExtras.h:1349:29 #2 0x151be6b in llvm::Function::Function(llvm::FunctionType*, llvm::GlobalValue::LinkageTypes, unsigned int, llvm::Twine const&, llvm::Module*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/lib/IR/Function.cpp:241 #3 0x7c4006 in Create /b/sanitizer-x86_64-linux-bootstrap/build/llvm/include/llvm/IR/Function.h:144:16 #4 0x7c4006 in (anonymous namespace)::FunctionTest_GetPointerAlignment_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/IR/FunctionTest.cpp:136 #5 0x1a836a0 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc #6 0x1a836a0 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2474 #7 0x1a85c55 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11 #8 0x1a870d0 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28 #9 0x1aa5b84 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43 #10 0x1aa4d30 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc #11 0x1aa4d30 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4257 #12 0x1a6b656 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46 #13 0x1a6b656 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50 #14 0x7f5af37a22e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) SUMMARY: AddressSanitizer: 168 byte(s) leaked in 2 allocation(s). ``` See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/11358/steps/check-llvm%20asan/logs/stdio for more information. Also introduces use-of-uninitialized-value in ConstantsTest.FoldGlobalVariablePtr: ``` ==7070==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x14e703c in User /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5 #1 0x14e703c in Constant /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/Constant.h:44 #2 0x14e703c in llvm::GlobalValue::GlobalValue(llvm::Type*, llvm::Value::ValueTy, llvm::Use*, unsigned int, llvm::GlobalValue::LinkageTypes, llvm::Twine const&, unsigned int) /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalValue.h:78 #3 0x14e5467 in GlobalObject /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/GlobalObject.h:34:9 #4 0x14e5467 in llvm::GlobalVariable::GlobalVariable(llvm::Type*, bool, llvm::GlobalValue::LinkageTypes, llvm::Constant*, llvm::Twine const&, llvm::GlobalValue::ThreadLocalMode, unsigned int, bool) /b/sanitizer-x86_64-linux-fast/build/llvm/lib/IR/Globals.cpp:314 #5 0x6938f1 in llvm::(anonymous namespace)::ConstantsTest_FoldGlobalVariablePtr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm/unittests/IR/ConstantsTest.cpp:565:18 #6 0x1a240a1 in HandleExceptionsInMethodIfSupported<testing::Test, void> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc #7 0x1a240a1 in testing::Test::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2474 #8 0x1a26d26 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11 #9 0x1a2815f in testing::TestCase::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28 #10 0x1a43de8 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43 #11 0x1a42c47 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc #12 0x1a42c47 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/src/gtest.cc:4257 #13 0x1a0dfba in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46 #14 0x1a0dfba in main /b/sanitizer-x86_64-linux-fast/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:50 #15 0x7f2081c412e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0) #16 0x4dff49 in _start (/b/sanitizer-x86_64-linux-fast/build/llvm_build_msan/unittests/IR/IRTests+0x4dff49) SUMMARY: MemorySanitizer: use-of-uninitialized-value /b/sanitizer-x86_64-linux-fast/build/llvm/include/llvm/IR/User.h:79:5 in User ``` See http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/30222/steps/check-llvm%20msan/logs/stdio for more information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355616 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 5.0]Add initial support for 'allocate' directive.Alexey Bataev2019-03-071-0/+6
| | | | | | | Added parsing/sema analysis/serialization/deserialization support for 'allocate' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355614 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Fix CXTranslationUnit_KeepGoingIvan Donchevskii2019-03-071-1/+6
| | | | | | | | | | | | | | | | | | Since commit 56f548bbbb7e4387a69708f70724d00e9e076153 [modules] Round-trip -Werror flag through explicit module build. the behavior of CXTranslationUnit_KeepGoing changed: Unresolved #includes are fatal errors again. As a consequence, some templates are not instantiated and lead to confusing errors. Revert to the old behavior: With CXTranslationUnit_KeepGoing fatal errors are mapped to errors. Patch by Nikolai Kosjar. Differential Revision: https://reviews.llvm.org/D58501 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355586 91177308-0d34-0410-b5e6-96231b3b80d8
* [IR][ARM] Add function pointer alignment to datalayoutMichael Platings2019-03-071-11/+12
| | | | | | | | | Use this feature to fix a bug on ARM where 4 byte alignment is incorrectly assumed. Differential Revision: https://reviews.llvm.org/D57335 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355585 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[IR][ARM] Add function pointer alignment to datalayout"Mitch Phillips2019-03-061-12/+11
| | | | | | | | | | | | | This reverts commit 2391bfca97290181ae65796ea6da135d1b6d037b. This reverts rL355522 (https://reviews.llvm.org/D57335). Kills buildbots that use '-Werror' with the following error: /var/lib/buildbot/sanitizer-buildbot6/sanitizer-x86_64-linux-android/build/llvm/lib/IR/Value.cpp:657:7: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default] See buildbots http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/30200/steps/check-llvm%20asan/logs/stdio for more information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355537 91177308-0d34-0410-b5e6-96231b3b80d8
* [IR][ARM] Add function pointer alignment to datalayoutMichael Platings2019-03-061-11/+12
| | | | | | | | | Use this feature to fix a bug on ARM where 4 byte alignment is incorrectly assumed. Differential Revision: https://reviews.llvm.org/D57335 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355522 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang][OpenMP] Revert "OMPFlushClause is synthetic, no such clause exists"Roman Lebedev2019-03-061-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This reverts rL352390 / D57280. As discussed in https://reviews.llvm.org/D57112#inline-506781, 'flush' clause does not exist in the OpenMP spec, it can not be specified, and `OMPFlushClause` class is just a helper class. Now, here's the caveat. I have read @ABataev's > Well, I think it would be good to filter out OMPC_flush somehow > because there is no such clause actually, it is a pseudo clause > for better handling of the flush directive. as if that clause is pseudo clause that only exists for the sole purpose of simplifying the parser. As in, it never reaches AST. I did not however try to verify that. Too bad, i was wrong. It absolutely *does* reach AST. Therefore my understanding/justification for the change was flawed, which makes the patch a regression which **must** be reverted. @gribozavr has brought that up again in https://reviews.llvm.org/D57112#inline-521238 > > ... > Sorry to be late for this discussion, but I don't think this conclusion > follows. ASTMatchers are supposed to match the AST as it is. > Even if OMPC_flush is synthetic, it exists in the AST, and users might > want to match it. I think users would find anything else (trying to filter > out AST nodes that are not in the source code) to be surprising. For example, > there's a matcher materializeTemporaryExpr even though this AST node is a > Clang invention and is not a part of the C++ spec. > > Matching only constructs that appear in the source code is not feasible with > ASTMatchers, because they are based on Clang's AST that exposes tons of semantic > information, and its design is dictated by the structure of the semantic information. > See "RFC: Tree-based refactorings with Clang" in cfe-dev for a library that will > focus on representing source code as faithfully as possible. > > Not to even mention that this code is in ASTTypeTraits, a general library for > handling AST nodes, not specifically for AST Matchers... Reviewers: gribozavr, ABataev, rjmccall, aaron.ballman Reviewed By: gribozavr, ABataev Subscribers: dylanmckay, guansong, arphaman, jdoerfert, cfe-commits, gribozavr, ABataev Tags: #clang, #openmp Differential Revision: https://reviews.llvm.org/D58979 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355486 91177308-0d34-0410-b5e6-96231b3b80d8
* [Fixed Point Arithmetic] Fixed Point and Integer ConversionsLeonard Chan2019-03-061-0/+37
| | | | | | | | | This patch includes the necessary code for converting between a fixed point type and integer. This also includes constant expression evaluation for conversions with these types. Differential Revision: https://reviews.llvm.org/D56900 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355462 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace clang::FileData with llvm::vfs::StatusHarlan Haskins2019-03-052-51/+44
| | | | | | | | | | | | | | | | Summary: FileData was only ever used as a container for the values in llvm::vfs::Status, so they might as well be consolidated. The `InPCH` member was also always set to false, and unused. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58924 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355368 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak r355278 for compatibility with gcc 6 and earlier.James Y Knight2019-03-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355280 91177308-0d34-0410-b5e6-96231b3b80d8
* Tweak r355278 for compatibility with gcc 6 and earlier.James Y Knight2019-03-021-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355279 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the new SanitizerMask code added in r355190 constexpr.James Y Knight2019-03-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | Then, as a consequence, remove the complex set of workarounds for initialization order -- which are apparently not 100% reliable. The only downside is that some of the member functions are now specific to kNumElem == 2, and will need to be updated if that constant is increased in the future. Unfortunately, the current code caused an initialization-order runtime failure for me in some compilation modes. It appears that in a toolchain without init-array enabled, the order of initialization of static data members of a template can be reversed w.r.t. the order within a file. This caused e.g. SanitizerKind::CFI to be initialized to 0. I'm not quite sure if that is an allowable ordering variation, or nonconforming behavior, but in any case, making everything constexpr eliminates the possibility of such an issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355278 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-03-012-3/+14
| | | | | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". This is a recommit of r354873 but with a fix for unqualified lookup error in lldb cmake build bot. Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355190 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix file headers. NFCFangrui Song2019-03-011-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@355176 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] AMD znver2 enablementGanesh Gopalasubramanian2019-02-261-0/+8
| | | | | | | | | | | | | | | | | This patch enables the following 1) AMD family 17h "znver2" tune flag (-march, -mcpu). 2) ISAs that are enabled for "znver2" architecture. 3) For the time being, it uses the znver1 scheduler model. 4) Tests are updated. 5) This patch is the clang counterpart to D58343 Reviewers: craig.topper Tags: #clang Differential Revision: https://reviews.llvm.org/D58344 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354899 91177308-0d34-0410-b5e6-96231b3b80d8
* revert r354873 as this breaks lldb builds.Pierre Gousseau2019-02-262-14/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354875 91177308-0d34-0410-b5e6-96231b3b80d8
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-02-262-3/+14
| | | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354873 91177308-0d34-0410-b5e6-96231b3b80d8
* [OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.Michael Kruse2019-02-251-2/+18
| | | | | | | | | | | | | | | | | | | | This patch implements the parsing and sema support for the OpenMP 'from'-clause with potential user-defined mappers attached. User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device Contributed-by: Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D58638 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354817 91177308-0d34-0410-b5e6-96231b3b80d8