- May 01, 2020
-
-
Fangrui Song authored
The current implementation assumes that R_PPC64_TOC16_HA is always followed by R_PPC64_TOC16_LO_DS. This can break with R_PPC64_TOC16_LO: // Load the address of the TOC entry, instead of the value stored at that address addis 3, 2, .LC0@tloc@ha # R_PPC64_TOC16_HA addi 3, 3, .LC0@tloc@l # R_PPC64_TOC16_LO blr which is used by boringssl's util/fipstools/delocate/delocate.go https://github.com/google/boringssl/blob/master/crypto/fipsmodule/FIPS.md has some documentation. In short, this tool converts an assembly file to avoid any potential relocations. The distance to an input .toc is not a constant after linking, so it cannot use an `addis;ld` pair. Instead, it jumps to a stub which loads the TOC entry address with `addis;addi`. This patch checks the presence of R_PPC64_TOC16_LO and suppresses toc-indirect to toc-relative relaxation if R_PPC64_TOC16_LO is seen. This approach is conservative and loses some relaxation opportunities but is easy to implement. addis 3, 2, .LC0@toc@ha # no relaxation addi 3, 3, .LC0@toc@l # no relaxation li 9, 0 addis 4, 2, .LC0@toc@ha # can relax but suppressed ld 4, .LC0@toc@l(4) # can relax but suppressed Also note that interleaved R_PPC64_TOC16_HA and R_PPC64_TOC16_LO_DS is possible and this patch accounts for that. addis 3, 2, .LC1@toc@ha # can relax addis 4, 2, .LC2@toc@ha # can relax ld 3, .LC1@toc@l(3) # can relax ld 4, .LC2@toc@l(4) # can relax Reviewed By: #powerpc, sfertile Differential Revision: https://reviews.llvm.org/D78431
-
Hans Wennborg authored
The intention here seems to be to end the generator function, but with modern Python, raising StopIteration causes a runtime error (https://www.python.org/dev/peps/pep-0479/). Differential revision: https://reviews.llvm.org/D79169
-
Aaron Smith authored
Summary: Before this change enums were formatted incorrectly for the Microsoft style. [C++ Example] enum { one, two } three, four; [Incorrectly Formatted] enum { one, two } three, four; [Correct Format with Patch] enum { one, two } three, four; Reviewers: jbcoe, MyDeveloperDay, rnk Reviewed By: MyDeveloperDay Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D78982
-
- Apr 30, 2020
-
-
Louis Dionne authored
Tests that require support for Clang-verify are already marked as such explicitly by their extension, which is .verify.cpp. Requiring the use of an explicit Lit feature is, after thought, not really helpful. This is a change in design: we have been bitten in the past by tests not being enabled when we thought they were. However, the issue was mostly with file extensions being ignored. The fix for that is not to blindly require explicit features all the time, but instead to report all files that are in the suite but that don't match any known test format. This can be implemented in a follow-up patch.
-
Fangrui Song authored
Similar to D70264. Create COFF/, ELF/, MachO/, Minidump/, XCOFF/, and move tests there. Reviewed By: grimar, jhenderson, labath Differential Revision: https://reviews.llvm.org/D79154
-
Kirill Naumov authored
The assert checks that every instruction must be annotated by this point while it is not necessary. If the inlining process was interrupted because the threshold was reached, the rest of the instructions would not be annotated which triggers the assert. The added test shows the situation in which it can happen. This is a recommit as the original commit fail due to the absence of REQUIRES: assert in the test. Reviewed By: mtrofin Differential Revision: https://reviews.llvm.org/D79107
-
Simon Pilgrim authored
Add AVX512VL tests and v2i64/v8i64 mask broadcast tests that match the existing v4i64 versions
-
Simon Pilgrim authored
Fold BROADCAST(NOT(Y)) -> BROADCAST(Y) as part of finding a NOT inversion.
-
Jann Horn authored
Summary: In the LLVM IR, "call" instructions read memory for each byval operand. For example: ``` $ cat blah.c struct foo { void *a, *b, *c; }; struct bar { struct foo foo; }; void func1(const struct foo); void func2(struct bar *bar) { func1(bar->foo); } $ [...]/bin/clang -S -flto -c blah.c -O2 ; cat blah.s [...] define dso_local void @func2(%struct.bar* %bar) local_unnamed_addr #0 { entry: %foo = getelementptr inbounds %struct.bar, %struct.bar* %bar, i64 0, i32 0 tail call void @func1(%struct.foo* byval(%struct.foo) align 8 %foo) #2 ret void } [...] $ [...]/bin/clang -S -c blah.c -O2 ; cat blah.s [...] func2: # @func2 [...] subq $24, %rsp [...] movq 16(%rdi), %rax movq %rax, 16(%rsp) movups (%rdi), %xmm0 movups %xmm0, (%rsp) callq func1 addq $24, %rsp [...] retq ``` Let ASAN instrument these hidden memory accesses. This is patch 4/4 of a patch series: https://reviews.llvm.org/D77616 [PATCH 1/4] [AddressSanitizer] Refactor ClDebug{Min,Max} handling https://reviews.llvm.org/D77617 [PATCH 2/4] [AddressSanitizer] Split out memory intrinsic handling https://reviews.llvm.org/D77618 [PATCH 3/4] [AddressSanitizer] Refactor: Permit >1 interesting operands per instruction https://reviews.llvm.org/D77619 [PATCH 4/4] [AddressSanitizer] Instrument byval call arguments Reviewers: kcc, glider Reviewed By: glider Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77619 -
Jann Horn authored
Summary: Refactor getInterestingMemoryOperands() so that information about the pointer operand is returned through an array of structures instead of passing each piece of information separately by-value. This is in preparation for returning information about multiple pointer operands from a single instruction. A side effect is that, instead of repeatedly generating the same information through isInterestingMemoryAccess(), it is now simply collected once and then passed around; that's probably more efficient. HWAddressSanitizer has a bunch of copypasted code from AddressSanitizer, so these changes have to be duplicated. This is patch 3/4 of a patch series: https://reviews.llvm.org/D77616 [PATCH 1/4] [AddressSanitizer] Refactor ClDebug{Min,Max} handling https://reviews.llvm.org/D77617 [PATCH 2/4] [AddressSanitizer] Split out memory intrinsic handling https://reviews.llvm.org/D77618 [PATCH 3/4] [AddressSanitizer] Refactor: Permit >1 interesting operands per instruction https://reviews.llvm.org/D77619 [PATCH 4/4] [AddressSanitizer] Instrument byval call arguments [glider: renamed llvm::InterestingMemoryOperand::Type to OpType to fix GCC compilation] Reviewers: kcc, glider Reviewed By: glider Subscribers: hiraditya, jfb, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77618
-
Jann Horn authored
Summary: In both AddressSanitizer and HWAddressSanitizer, we first collect instructions whose operands should be instrumented and memory intrinsics, then instrument them. Both during collection and when inserting instrumentation, they are handled separately. Collect them separately and instrument them separately. This is a bit more straightforward, and prepares for collecting operands instead of instructions in a future patch. This is patch 2/4 of a patch series: https://reviews.llvm.org/D77616 [PATCH 1/4] [AddressSanitizer] Refactor ClDebug{Min,Max} handling https://reviews.llvm.org/D77617 [PATCH 2/4] [AddressSanitizer] Split out memory intrinsic handling https://reviews.llvm.org/D77618 [PATCH 3/4] [AddressSanitizer] Refactor: Permit >1 interesting operands per instruction https://reviews.llvm.org/D77619 [PATCH 4/4] [AddressSanitizer] Instrument byval call arguments Reviewers: kcc, glider Reviewed By: glider Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77617
-
Jann Horn authored
Summary: A following commit will split the loop over ToInstrument into two. To avoid having to duplicate the condition for suppressing instrumentation sites based on ClDebug{Min,Max}, refactor it out into a new function. While we're at it, we can also avoid the indirection through NumInstrumented for setting FunctionModified. This is patch 1/4 of a patch series: https://reviews.llvm.org/D77616 [PATCH 1/4] [AddressSanitizer] Refactor ClDebug{Min,Max} handling https://reviews.llvm.org/D77617 [PATCH 2/4] [AddressSanitizer] Split out memory intrinsic handling https://reviews.llvm.org/D77618 [PATCH 3/4] [AddressSanitizer] Refactor: Permit >1 interesting operands per instruction https://reviews.llvm.org/D77619 [PATCH 4/4] [AddressSanitizer] Instrument byval call arguments Reviewers: kcc, glider Reviewed By: glider Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77616 -
Benjamin Kramer authored
-
Sebastian Neubauer authored
When embedding LLVM as a CMake subproject, using cross-compiling does not work at the moment. This also affects -DLLVM_OPTIMIZED_TABLEGEN=1, which uses the same CMake infrastructure. This patch replaces global CMake variables with the current version, which allows cross-compilation to work in a subproject. CMAKE_BINARY_DIR -> CMAKE_CURRENT_BINARY_DIR CMAKE_SOURCE_DIR -> CMAKE_CURRENT_SOURCE_DIR CMAKE_PROJECT_NAME -> PROJECT_NAME Differential Revision: https://reviews.llvm.org/D78913
-
Kadir Cetinkaya authored
-
Raphael Isemann authored
This file currently doesn't compile under LLVM_ENABLE_MODULES as SmallVector is used in this header but is never forward declared or included in any way. Let's include SmallVector.h instead and get rid of the SmallVectorImpl fwd declaration which is now no longer necessary.
-
Jay Foad authored
-
Alexander Potapenko authored
I couldn't make arc land the changes properly, for some reason they all got squashed. Reverting them now to land cleanly. Summary: This reverts commit cfb5f89b. Reviewers: kcc, thejh Subscribers:
-
diggerlin authored
SUMMARY: emit .extern and .weak directive linkage Reviewers: hubert.reinterpretcast, Jason Liu Subscribers: wuzish, nemanjai, hiraditya Differential Revision: https://reviews.llvm.org/D76932
-
Simon Pilgrim authored
Shows issue that the IsNot() test can't see through shuffles/broadcasts
-
Kadir Cetinkaya authored
-
Jann Horn authored
Summary: A following commit will split the loop over ToInstrument into two. To avoid having to duplicate the condition for suppressing instrumentation sites based on ClDebug{Min,Max}, refactor it out into a new function. While we're at it, we can also avoid the indirection through NumInstrumented for setting FunctionModified. This is patch 1/4 of a patch series: https://reviews.llvm.org/D77616 [PATCH 1/4] [AddressSanitizer] Refactor ClDebug{Min,Max} handling https://reviews.llvm.org/D77617 [PATCH 2/4] [AddressSanitizer] Split out memory intrinsic handling https://reviews.llvm.org/D77618 [PATCH 3/4] [AddressSanitizer] Refactor: Permit >1 interesting operands per instruction https://reviews.llvm.org/D77619 [PATCH 4/4] [AddressSanitizer] Instrument byval call arguments Reviewers: kcc, glider Reviewed By: glider Subscribers: jfb, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D77616 -
Lei Zhang authored
This commit marks AllocLikeOp as MemAlloc in StandardOps. Also in Linalg dependency analysis use memory effect to detect allocation. This allows the dependency analysis to be more general and recognize other allocation-like operations. Differential Revision: https://reviews.llvm.org/D78705
-
Sanjay Patel authored
-
Sanjay Patel authored
-
jasonliu authored
Use unique_ptr to manage the lifetime of ABIInfo member inside TargetCodeGenInfo. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D79033
-
Kadir Cetinkaya authored
-
Simon Pilgrim authored
X86 matches several 'shift+xor' funnel shift patterns: fold (or (srl (srl x1, 1), (xor y, 31)), (shl x0, y)) -> (fshl x0, x1, y) fold (or (shl (shl x0, 1), (xor y, 31)), (srl x1, y)) -> (fshr x0, x1, y) fold (or (shl (add x0, x0), (xor y, 31)), (srl x1, y)) -> (fshr x0, x1, y) These patterns are also what we end up with the proposed expansion changes in D77301. This patch moves these to DAGCombine's generic MatchFunnelPosNeg. All existing X86 test cases still pass, and we just have a small codegen change in pr32282.ll. Reviewed By: @spatel Differential Revision: https://reviews.llvm.org/D78935
-
Simon Pilgrim authored
As discussed on D78935
-
Sanjay Patel authored
-
Jay Foad authored
-
David Spickett authored
of a struct that cover the whole struct This can happen when the rest of the members of are zero length. Following the same pattern applied to the SROA pass in: d7f6f163 Fixes: https://bugs.llvm.org/show_bug.cgi?id=45335 Differential Revision: https://reviews.llvm.org/D78720
-
Sam Elliott authored
-
Cullen Rhodes authored
Summary: FP reductions no longer use these intrinsics since D78723. Reviewers: efriedma, sdesmalen Reviewed By: efriedma, sdesmalen Differential Revision: https://reviews.llvm.org/D79010
-
Cullen Rhodes authored
Summary: This patch implements custom floating-point reduction ISD nodes that have vector results, which are used to lower the following intrinsics: * llvm.aarch64.sve.fadda * llvm.aarch64.sve.faddv * llvm.aarch64.sve.fmaxv * llvm.aarch64.sve.fmaxnmv * llvm.aarch64.sve.fminv * llvm.aarch64.sve.fminnmv SVE reduction instructions keep their result within a vector register, with all other bits set to zero. Changes in this patch were implemented by Paul Walker and Sander de Smalen. Reviewers: sdesmalen, efriedma, rengolin Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D78723 -
David Sherwood authored
Summary: This patch tries to ensure that we do something sensible when generating code for the ISD::INSERT_VECTOR_ELT DAG node when operating on scalable vectors. Previously we always returned 'undef' when inserting an element into an out-of-bounds lane index, whereas now we only do this for fixed length vectors. For scalable vectors it is assumed that the backend will do the right thing in the same way that we have to deal with variable lane indices. In this patch I have permitted a few basic combinations for scalable vector types where it makes sense, but in general avoided most cases for now as they currently require the use of BUILD_VECTOR nodes. This patch includes tests for all scalable vector types when inserting into lane 0, but I've only included one or two vector types for other cases such as variable lane inserts. Differential Revision: https://reviews.llvm.org/D78992
-
Kadir Cetinkaya authored
-
mydeveloperday authored
Summary: The condition added with the new setting checked whether the character was an l-brace, not specifically a lambda l-brace, when deciding whether it was possible to break before it or not. This caused the l-brace of some initialiser lists to break onto the next line with the first argument of the initialiser list when the setting was enabled. Reviewed By: MyDeveloperDay, Wawha Patch By: duncan-llvm Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D79022
-
mydeveloperday authored
Summary: Due to the order in which the enum cases were defined the old options which were retained for backwards compatibility were being preferred over the new options when printing with the --dump-config option. Reviewers: MyDeveloperDay Reviewed By: MyDeveloperDay Patch By: duncan-llvm Subscribers: cfe-commits Tags: #clang, #clang-format Differential Revision: https://reviews.llvm.org/D79020
-
mydeveloperday authored
Summary: BTW my actual code that hit this issue is like ``` [a, b = std::move(b)](auto &&... c) mutable -> std::invoke_result_t<decltype(b), decltype(c)...> { /* omitted */ } ``` where this explicit return type is required for SFINAE. Reviewed By: krasimir, MyDeveloperDay Patch By: johnchen902 Subscribers: krasimir, dexonsmith, cfe-commits Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D78694
-