- Jul 08, 2019
-
-
Chris Bieneman authored
Summary: CMake+Xcode doesn't seem to handle targets that only have object sources. This patch works around that limitation by adding a dummy soruce file to any library target that is generated by llvm_add_library when object libraries are generated. Object libraries are generated whenever llvm_add_library is passed more than one library type, which is now the default case for clang static libraries (which generate STATIC and OBJECT libraries). Reviewers: zturner, compnerd, joanlluch Reviewed By: joanlluch Subscribers: joanlluch, xbolva00, mgorny, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64300 llvm-svn: 365365
-
Sam McCall authored
Summary: Also implement resolution of paths relative to mainfile without HeaderSearchInfo. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64293 llvm-svn: 365364
-
Denis Bakhvalov authored
Change-Id: I76c9f628c092ae3e6e78ebdaf55cec726e25d692 llvm-svn: 365363
-
Sanjay Patel authored
llvm-svn: 365362
-
Vitaly Buka authored
llvm-svn: 365361
-
Yonghong Song authored
This reverts commit r365352. Test ThinLTO/X86/lazyload_metadata.ll failed. Revert the commit and at the same time to fix the issue. llvm-svn: 365360
-
Vitaly Buka authored
Revert "[libc++] Take 2: Do not cleverly link against libc++abi just because it happens to be there" r365326 still breaks bots: http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20712/steps/ninja%20build%20local/logs/stdio http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/39477/steps/test%20tsan%20in%20debug%20compiler-rt%20build/logs/stdio And probably others This reverts commit 945b9ec0. llvm-svn: 365359
-
Jonas Devlieghere authored
Add missing interface changes after r365295. llvm-svn: 365358
-
Amy Huang authored
extra temporary variable to be created. llvm-svn: 365357
-
Sam McCall authored
Summary: I didn't manage to find something nicer than optional<bool>, but at least I found a sneakier comment. Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64216 llvm-svn: 365356
-
Ilya Biryukov authored
Summary: A tooling-focused alternative to the AST. This commit focuses on the memory-management strategy and the structure of the AST. More to follow later: - Operations to mutate the syntax trees and corresponding textual replacements. - Mapping between clang AST nodes and syntax tree nodes. - More node types corresponding to the language constructs. Reviewers: sammccall Reviewed By: sammccall Subscribers: llvm-commits, mgorny, cfe-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61637 llvm-svn: 365355
-
Vitaly Buka authored
llvm-svn: 365354
-
Dmitry Preobrazhensky authored
Corrected a typo. llvm-svn: 365353
-
Yonghong Song authored
For background of BPF CO-RE project, please refer to http://vger.kernel.org/bpfconf2019.html In summary, BPF CO-RE intends to compile bpf programs adjustable on struct/union layout change so the same program can run on multiple kernels with adjustment before loading based on native kernel structures. In order to do this, we need keep track of GEP(getelementptr) instruction base and result debuginfo types, so we can adjust on the host based on kernel BTF info. Capturing such information as an IR optimization is hard as various optimization may have tweaked GEP and also union is replaced by structure it is impossible to track fieldindex for union member accesses. Three intrinsic functions, preserve_{array,union,struct}_access_index, are introducted. addr = preserve_array_access_index(base, index, dimension) addr = preserve_union_access_index(base, di_index) addr = preserve_struct_access_index(base, gep_index, di_index) here, base: the base pointer for the array/union/struct access. index: the last access index for array, the same for IR/DebugInfo layout. dimension: the array dimension. gep_index: the access index based on IR layout. di_index: the access index based on user/debuginfo types. For example, for the following example, $ cat test.c struct sk_buff { int i; int b1:1; int b2:2; union { struct { int o1; int o2; } o; struct { char flags; char dev_id; } dev; int netid; } u[10]; }; static int (*bpf_probe_read)(void *dst, int size, const void *unsafe_ptr) = (void *) 4; #define _(x) (__builtin_preserve_access_index(x)) int bpf_prog(struct sk_buff *ctx) { char dev_id; bpf_probe_read(&dev_id, sizeof(char), _(&ctx->u[5].dev.dev_id)); return dev_id; } $ clang -target bpf -O2 -g -emit-llvm -S -mllvm -print-before-all \ test.c >& log The generated IR looks like below: ... define dso_local i32 @bpf_prog(%struct.sk_buff*) #0 !dbg !15 { %2 = alloca %struct.sk_buff*, align 8 %3 = alloca i8, align 1 store %struct.sk_buff* %0, %struct.sk_buff** %2, align 8, !tbaa !45 call void @llvm.dbg.declare(metadata %struct.sk_buff** %2, metadata !43, metadata !DIExpression()), !dbg !49 call void @llvm.lifetime.start.p0i8(i64 1, i8* %3) #4, !dbg !50 call void @llvm.dbg.declare(metadata i8* %3, metadata !44, metadata !DIExpression()), !dbg !51 %4 = load i32 (i8*, i32, i8*)*, i32 (i8*, i32, i8*)** @bpf_probe_read, align 8, !dbg !52, !tbaa !45 %5 = load %struct.sk_buff*, %struct.sk_buff** %2, align 8, !dbg !53, !tbaa !45 %6 = call [10 x %union.anon]* @llvm.preserve.struct.access.index.p0a10s_union.anons.p0s_struct.sk_buffs( %struct.sk_buff* %5, i32 2, i32 3), !dbg !53, !llvm.preserve.access.index !19 %7 = call %union.anon* @llvm.preserve.array.access.index.p0s_union.anons.p0a10s_union.anons( [10 x %union.anon]* %6, i32 1, i32 5), !dbg !53 %8 = call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons( %union.anon* %7, i32 1), !dbg !53, !llvm.preserve.access.index !26 %9 = bitcast %union.anon* %8 to %struct.anon.0*, !dbg !53 %10 = call i8* @llvm.preserve.struct.access.index.p0i8.p0s_struct.anon.0s( %struct.anon.0* %9, i32 1, i32 1), !dbg !53, !llvm.preserve.access.index !34 %11 = call i32 %4(i8* %3, i32 1, i8* %10), !dbg !52 %12 = load i8, i8* %3, align 1, !dbg !54, !tbaa !55 %13 = sext i8 %12 to i32, !dbg !54 call void @llvm.lifetime.end.p0i8(i64 1, i8* %3) #4, !dbg !56 ret i32 %13, !dbg !57 } !19 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "sk_buff", file: !3, line: 1, size: 704, elements: !20) !26 = distinct !DICompositeType(tag: DW_TAG_union_type, scope: !19, file: !3, line: 5, size: 64, elements: !27) !34 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !26, file: !3, line: 10, size: 16, elements: !35) Note that @llvm.preserve.{struct,union}.access.index calls have metadata llvm.preserve.access.index attached to instructions to provide struct/union debuginfo type information. For &ctx->u[5].dev.dev_id, . The "%6 = ..." represents struct member "u" with index 2 for IR layout and index 3 for DI layout. . The "%7 = ..." represents array subscript "5". . The "%8 = ..." represents union member "dev" with index 1 for DI layout. . The "%10 = ..." represents struct member "dev_id" with index 1 for both IR and DI layout. Basically, traversing the use-def chain recursively for the 3rd argument of bpf_probe_read() and examining all preserve_*_access_index calls, the debuginfo struct/union/array access index can be achieved. The intrinsics also contain enough information to regenerate codes for IR layout. For array and structure intrinsics, the proper GEP can be constructed. For union intrinsics, replacing all uses of "addr" with "base" should be enough. Signed-off-by:
Yonghong Song <yhs@fb.com> Differential Revision: https://reviews.llvm.org/D61810 llvm-svn: 365352
-
Wouter van Oortmerssen authored
Summary: Before, they were one category of operands which could cause crashes in non-sensical combinations, e.g. "f32.const symbol". Now these are forced to be an error. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, aheejin, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64039 llvm-svn: 365351
-
Matt Arsenault authored
These are identical to the *_global PatFrag, and will only create more work to get the GlobalISel importer to handle them. llvm-svn: 365350
-
Matt Arsenault authored
llvm-svn: 365349
-
George Rimar authored
This patch removes trivial-object-test.elf-i386, trivial-object-test.elf-x86-64 and trivial-object-test2.elf-x86-64 precompiled objects from test/Object/Inputs folder. I adjusted the existent test cases to use YAML instead. Differential revision: https://reviews.llvm.org/D64206 llvm-svn: 365348
-
Dmitry Preobrazhensky authored
Summary of changes: - added description of GFX10; - added description of operands sccz, vccz, lds_direct, etc; - minor bugfixing and improvements. llvm-svn: 365347
-
Louis Dionne authored
llvm-svn: 365346
-
Brian Homerding authored
Removing dead code leftover from refactor. Reviewers: jdoerfert Differential Revision: https://reviews.llvm.org/D49165 llvm-svn: 365345
-
Jonas Devlieghere authored
llvm-svn: 365344
-
Matt Arsenault authored
llvm-svn: 365343
-
Sanjay Patel authored
We recognize a splat from element 0 in (VectorUtils) llvm::getSplatValue() and also in ShuffleVectorInst::isZeroEltSplatMask(), so this converts to that form for better matching. The backend generically turns these patterns into build_vector, so there should be no codegen difference. llvm-svn: 365342
-
Brian Homerding authored
The revision at https://reviews.llvm.org/rL365336 added inference of the nofree attribute. This revision updates the test to reflect this. Differential Revision: https://reviews.llvm.org/D49165 llvm-svn: 365341
-
Francis Visoiu Mistrih authored
llvm-svn: 365340
-
Kevin P. Neal authored
The IRBuilder has calls to create floating point instructions like fadd. It does not have calls to create constrained versions of them. This patch adds support for constrained creation of fadd, fsub, fmul, fdiv, and frem. Reviewed by: John McCall, Sanjay Patel Approved by: John McCall Differential Revision: https://reviews.llvm.org/D53157 llvm-svn: 365339
-
Michal Gorny authored
llvm-svn: 365338
-
Louis Dionne authored
Also, use a single point of customization to set what namespace __par_backend "points to", which provides a better separation of concerns. llvm-svn: 365337
-
Brian Homerding authored
This patch adds a function attribute, nofree, to indicate that a function does not, directly or indirectly, call a memory-deallocation function (e.g., free, C++'s operator delete). Reviewers: jdoerfert Differential Revision: https://reviews.llvm.org/D49165 llvm-svn: 365336
-
James Henderson authored
llvm-svn: 365335
-
Alexey Bataev authored
NFC. llvm-svn: 365334
-
Sanjay Patel authored
I added this test in rL365325, but didn't mean to create an undef insert. llvm-svn: 365333
-
Alexey Bataev authored
Summary: __kmpc_push_tripcount function is not thread safe and may lead to data race when the target regions are executed in parallel threads. The patch makes loopTripCnt counter thread aware and stores the tripcount value per thread in the map. Access to map is guarded by mutex to prevent data race in the map itself. Test is for NVPTX target because it does not work correctly on the host. Seems to me, there is a problem in libomp with target regions in the parallel threads. Reviewers: grokos Subscribers: guansong, jfb, jdoerfert, openmp-commits, kkwli0, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D64080 llvm-svn: 365332
-
Ilya Biryukov authored
Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61681 llvm-svn: 365331
-
Jinsong Ji authored
llvm-svn: 365330
-
Alex Bradbury authored
Use new helper introduced in rL365327. llvm-svn: 365329
-
Simon Pilgrim authored
Keep the uint64_t type from getConstantOperandVal to stop truncation/extension overflow warnings in MSVC in subvector index math. llvm-svn: 365328
-
Alex Bradbury authored
This matches isARM, isThumb, isAArch64 and similar helpers. Future commits which clean-up code that currently checks for Triple::riscv32 || Triple::riscv64. Differential Revision: https://reviews.llvm.org/D54215 Patch by Simon Cook. Test case added by Alex Bradbury. llvm-svn: 365327
-
Louis Dionne authored
Summary: Otherwise, when libcxxabi is not an enabled project in the monorepo, we get a link error because we try to link against non-existent cxxabi_shared. More generally, we shouldn't change the behavior of the build based on implicit things like whether a file happens to be at a specific path or not. This is a re-application of r365222 that had been reverted in r365233 because it broke the build bots. However, the build bots now specify explicitly what ABI library they want to use (libc++abi), so this commit should now be OK to merge. Differential Revision: https://reviews.llvm.org/D63883 llvm-svn: 365326
-