- Aug 25, 2023
-
-
Jessica Clarke authored
On FreeBSD and NetBSD we don't use .weak due to differing semantics. Currently we end up using no directive, which gives a local symbol, whereas the closer thing to a weak symbol would be a global one. In particular, both GNU and LLVM toolchains cannot handle a GOT-indirect reference to a local symbol at a non-zero offset within a section on AArch64 (see https://github.com/ARM-software/abi-aa/issues/217), and so interceptors do not work on FreeBSD/arm64, failing to link with LLD. Switching to .globl both works around this bug and more closely aligns such non-weak platforms with weak ones. Fixes https://github.com/llvm/llvm-project/issues/63418 Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158552 (cherry picked from commit 7e1afab1)
-
- Aug 22, 2023
-
-
Sean Fertile authored
This reverts commit 5e28d30f. (cherry picked from commit cef56b93)
-
Sean Fertile authored
This reverts commit b37c7ed0. (cherry picked from commit ce658829)
-
Nikita Popov authored
The zext constant expression was detected by the fold, but then handled as a sext. Use ZExtOperator instead of ZExtInst to handle constant expressions. Fixes https://github.com/llvm/llvm-project/issues/64669. (cherry picked from commit c15ccfb2)
-
Koakuma authored
Add support for DONE, RETRY, SAVED, and RESTORED (v9 Section A.11 & Section A.47). Those instructions are used for low-level interrupt handling and register window management by OS kernels. Reviewed By: barannikov88 Differential Revision: https://reviews.llvm.org/D144936 (cherry picked from commit bf499ec2)
-
Simon Pilgrim authored
D152276 wasn't handling the case where the inserted element is implicitly truncated into the vector - resulting in a i1 element (implicitly truncated from i8) overwriting 8 bits instead of 1 bit. This patch is intended to be merged into 17.x so I've just disallowed any vector element vs inserted element type mismatch - technically we could be more elegant and permit truncated stores (as long as the store is still byte sized), but the use cases for that are so limited I'd prefer to play it safe for now. Candidate patch for #64655 17.x merge Differential Revision: https://reviews.llvm.org/D158366 (cherry picked from commit ba818c40)
-
Simon Pilgrim authored
(cherry picked from commit 2c090e9e)
-
wangpc authored
In D146245, we have supported lowering inline asm `m` with offset to `register+imm`, but we didn't handle the case that the offset is the low part of global address. This patch will emit `%lo(g)` when `g` is a global address. Fixes #64656 Reviewed By: asb Differential Revision: https://reviews.llvm.org/D157839 (cherry picked from commit dc60003e)
-
wangpc authored
We will need to check the output of medium code model. Reviewed By: wangpc Differential Revision: https://reviews.llvm.org/D157965 (cherry picked from commit a3b11ce7)
-
Martin Storsjö authored
This fixes a regression since 1c10d5b1 / https://reviews.llvm.org/D130903 by applying the same fix from SelectionDAG from 8cb36675 / https://reviews.llvm.org/D35720. This could possibly have been detected if the existing testcases in win64_vararg.ll had been tested with GlobalISel too, but all the IR snippets there fail to be translated with GlobalISel. This adds a separate testcase based on real world LLVM IR (instead of hand-reduced IR), which GlobalISel does translate happily - tested with both SelectionDAG and GlobalISel. Before this change, the stack object locations (visible in MIR with "llc -print-after-all") didn't match with what the prologue emitted by AArch64FrameLowering actually looked like, which caused clobbered callee saved registers when function local stack objects aliased the actual location of the callee saved registers. This fixes https://github.com/llvm/llvm-project/issues/64740. Differential Revision: https://reviews.llvm.org/D158272 (cherry picked from commit 955d7615)
-
Aaron Ballman authored
-
Aaron Ballman authored
-
Aaron Ballman authored
We were calling `isFunctionProtoType()` on a `ParsedType` rather than creating a valid semantic type first and calling the function on that. The call to `isFunctionProtoType()` would eventually call `getUnqualifiedDesugaredType()`, which loops indefinitely until we get a desugared type and a `ParsedType` will never finish desugaring. Fixes https://github.com/llvm/llvm-project/issues/64713
-
Eduard Zingerman authored
When LLVM is build with `LLVM_ENABLE_EXPENSIVE_CHECKS=ON` option the following C code snippet: struct t { unsigned long a; } __attribute__((preserve_access_index)); void foo(volatile struct t *t, volatile unsigned long *p) { *p = t->a; *p = t->a; } Causes an assertion: $ clang -g -O2 -c --target=bpf -mcpu=v2 t2.c -o /dev/null # After BPF PreEmit SimplifyPatchable # Machine code for function foo: IsSSA, TracksLiveness Function Live Ins: $r1 in %0, $r2 in %1 bb.0.entry: liveins: $r1, $r2 DBG_VALUE $r1, $noreg, !"t", !DIExpression() DBG_VALUE $r2, $noreg, !"p", !DIExpression() %1:gpr = COPY $r2 DBG_VALUE %1:gpr, $noreg, !"p", !DIExpression() %0:gpr = COPY $r1 DBG_VALUE %0:gpr, $noreg, !"t", !DIExpression() %2:gpr = LD_imm64 @"llvm.t:0:0$0:0" %4:gpr = ADD_rr %0:gpr(tied-def 0), killed %2:gpr %5:gpr = CORE_LD 344, %0:gpr, @"llvm.t:0:0$0:0" STD killed %5:gpr, %1:gpr, 0 %7:gpr = ADD_rr %0:gpr(tied-def 0), killed %2:gpr %8:gpr = CORE_LD 344, %0:gpr, @"llvm.t:0:0$0:0" STD killed %8:gpr, %1:gpr, 0 RET # End machine code for function foo. *** Bad machine code: Using a killed virtual register *** - function: foo - basic block: %bb.0 entry (0x6210000e6690) - instruction: %7:gpr = ADD_rr %0:gpr(tied-def 0), killed %2:gpr - operand 2: killed %2:gpr This happens because of the way BPFMISimplifyPatchable::processDstReg() updates second operand of the `ADD_rr` instruction. Code before `BPFMISimplifyPatchable`: .-> %2:gpr = LD_imm64 @"llvm.t:0:0$0:0" | |`----------------. | %3:gpr = LDD %2:gpr, 0 | %4:gpr = ADD_rr %0:gpr(tied-def 0), killed %3:gpr <--- (1) | %5:gpr = LDD killed %4:gpr, 0 ^^^^^^^^^^^^^ | STD killed %5:gpr, %1:gpr, 0 this is updated `----------------. %6:gpr = LDD %2:gpr, 0 %7:gpr = ADD_rr %0:gpr(tied-def 0), killed %6:gpr <--- (2) %8:gpr = LDD killed %7:gpr, 0 ^^^^^^^^^^^^^ STD killed %8:gpr, %1:gpr, 0 this is updated Instructions (1) and (2) would be updated to: ADD_rr %0:gpr(tied-def 0), killed %2:gpr The `killed` mark is inherited from machine operands `killed %3:gpr` and `killed %6:gpr` which are updated inplace by `processDstReg()`. This commit updates `processDstReg()` reset kill marks for updated machine operands to keep liveness information conservatively correct. Differential Revision: https://reviews.llvm.org/D157805 (cherry picked from commit 27026fe5) -
XinWang10 authored
Gather instructions could lead to security issues, details please refer to https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/gather-data-sampling.html. This supported options -mno-gather and -mno-scatter, which could avoid generating gather/scatter instructions in backend except using intrinsics or inline asms. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D157680
-
Josh Stone authored
In SystemZTTIImpl::getMemoryOpCost, the call to getNumberOfParts will run type legalization, which can't handle structs. So before that, we check for an unknown value type and forward to BaseT, just like many other targets do in this situation. https://bugzilla.redhat.com/show_bug.cgi?id=2224885 Reviewed By: uweigand Differential Revision: https://reviews.llvm.org/D156379 (cherry picked from commit 85e4ee15)
-
Rainer Orth authored
D157275 broke some buildbots that run with -Werror: https://lab.llvm.org/buildbot#builders/36/builds/36604 https://lab.llvm.org/buildbot#builders/57/builds/29201 Avoid this by using an overlong line rather than appeasing `clang-format`. (cherry picked from commit 18252e6c)
-
Rainer Orth authored
As described in Issue #53709 <https://github.com/llvm/llvm-project/issues/53709>, since 28d58d8f <https://reviews.llvm.org/rG28d58d8fe2094af6902dee7b4d68ec30a3e9d737> `clang` doesn't find the latest of several parallel GCC installations on Solaris, but only the first in directory order, which is pretty random. This patch sorts GCC installations in reverse version order so the latest is picked. Tested on `sparcv9-sun-solaris2.11`, `amd64-pc-solaris2.11`, and `x86_64-pc-linux-gnu`. Differential Revision: https://reviews.llvm.org/D157275 (cherry picked from commit ae84ad15)
-
usama hameed authored
bot (cherry picked from commit bb5f64a6)
-
usama hameed authored
getUBSanFunctionTypeHash. getUBSanFunctionTypeHash checks if a Type is a FunctionNoPrototype by calling isa<FunctionNoProtoType>(). This does not work correctly when the Type is wrapped in a sugar type such as an AttributedType. This patch fixes this by using isFunctionNoProtoType() function which removes sugar and returns the expected result. The added test is a sanity check that the compiler no longer crashes during compilation. It also compares the hash with and without the function attribute for both FunctionNoProtoType and FunctionProtoType. The hash remains the same for FunctionNoProtoType even with the addition of an attribute. rdar://113144087 Differential Revision: https://reviews.llvm.org/D157445 (cherry picked from commit 9afc57dc)
-
Fangrui Song authored
Constructs such as inline variables, #line, and #include can create lexical blocks with a different filename. GCOVProfiling and llvm-cov gcov currently don't handle such cases (see GCOVLines::writeOut and GCOVFile::readGCNO) and would incorrectly attribute the line number to the current file. For now, ignore such blocks. Missing line execution counts is better than wrong ones. --- As a workaround that Apple targets don't use -mconstructor-aliases yet, allow line execution count 4 on the A::A line (1f34e282). (cherry picked from commit 406e81b7)
-
- Aug 21, 2023
-
-
Mark de Wever authored
Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D158340 (cherry picked from commit 71a7192d)
-
Fangrui Song authored
assert is more appropriate here and fixes `runtime error: execution reached an unreachable program point` in a -DLLVM_USE_SANITIZER=Undefined build (-fno-sanitize-recover=all causes llc to exit instead of crash (report_fatal_error)) when testing MachineVerifier/test_g_assert_[sz]ext.mir. (cherry picked from commit a7e20dd6)
-
Fangrui Song authored
Tested by llvm/test/MC/ARM/basic-thumb2-instructions.s. Caught by newer -fsanitize=signed-integer-overflow (D156821). (cherry picked from commit d8900f66)
-
Fangrui Song authored
Tested by llvm/test/tools/llvm-readobj/ELF/relocations.test (cherry picked from commit 07bb6678)
-
Craig Topper authored
clang recently started checking for INT64_MIN being passed to 64-bit std::abs. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D158304 (cherry picked from commit 078eb4bd)
-
Paul Robinson authored
D155991 changed the file lookup to do a full string compare on the filename; however, this added ~0.5% to compile time with -g. Go back to the previous pointer-based lookup, but capture the main file's checksum as well as its name to use when creating the extra DIFile entry. This causes all entries to be consistent and also avoids computing the checksum twice. This reverts commit 5956648f. There was a string lifetime issue that is now corrected. Differential Revision: https://reviews.llvm.org/D156571 (cherry picked from commit 1fcc2bc3)
-
Jonas Hahnfeld authored
An inline virtual function must be emitted, but we need to remember it and emit the same definition again in the future in case later LLVM optimizations stripped it from the Module. The added test case shows the problem; before this patch, it would fail with: Symbols not found: [ _ZN1AD0Ev, _ZN1AD1Ev ] This reapplies commit f8dadefd, reverted in commit 0e17372b, but disables RTTI in the test to avoid problems on Windows. Differential Revision: https://reviews.llvm.org/D156537 (cherry picked from commit c861d32d) -
Jonas Hahnfeld authored
Reemission is only needed in incremental mode. With this early return, we avoid overhead from addEmittedDeferredDecl in non-incremental mode. Differential Revision: https://reviews.llvm.org/D157379 (cherry picked from commit d43a3d63)
-
Jonas Hahnfeld authored
GlobalDecls should only be added to EmittedDeferredDecls if they need reemission. This is checked in addEmittedDeferredDecl, which is called via addDeferredDeclToEmit. Extend these checks to also handle VarDecls (for lambdas, as tested in Interpreter/lambda.cpp) and remove the direct access of EmittedDeferredDecls in EmitGlobal that may actually end up duplicating FunctionDecls. Differential Revision: https://reviews.llvm.org/D156897 (cherry picked from commit b719e410)
-
Jonas Hahnfeld authored
This was unused since commit dd2362a8 last year. Differential Revision: https://reviews.llvm.org/D156891 (cherry picked from commit 2f3fe3ed)
-
Jonas Hahnfeld authored
A double colon starts an identifier name in the global namespace and must be tentatively parsed as such. Differential Revision: https://reviews.llvm.org/D157480 (cherry picked from commit ba475a4a)
-
Stefan Gränitz authored
We added support for the GNUstep ObjC runtime in 0b626473. In order to check if the target process uses GNUstep we run an expensive symbol lookup in `CreateInstance()`. This turned out to cause a heavy performance regression for non-GNUstep inferiors. This patch puts a cheaper check in front, so that the vast majority of requests should return early. This should fix the symptom for the moment. The conceptual question remains: Why does `LanguageRuntime::FindPlugin` invoke `create_callback` for each available runtime unconditionally in every `Process::ModulesDidLoad`? Reviewed By: jasonmolenda, jingham, bulbazord Differential Revision: https://reviews.llvm.org/D158205 (cherry picked from commit af2eb838)
-
Nathan Ridge authored
Fixes https://github.com/clangd/clangd/issues/1568 Differential Revision: https://reviews.llvm.org/D147905 (cherry picked from commit bd74186f)
-
Paul Kirth authored
FatLTO support is only half complete, and shouldn't be included in the 17.x release. https://reviews.llvm.org/D152973. This reverts commit 5784c478. This reverts commit 610fc5cb.
-
Louis Dionne authored
This patch fixes a few CMake options that were set using incorrect mechanisms. CMake's man page for the -D <var>=<value> option states: If a command in the project sets the type to PATH or FILEPATH, then the <value> will be converted to an absolute path. That's not what we want for most of the paths we have as configuration options. Otherwise, using -D to set the configuration option results in an absolute path being used, which breaks things. option() denotes a boolean variable, but what was desired was a string/list variable. Fix this to prevent cmake from changing any non-empty user provided values to 'ON'. Differential Revision: https://reviews.llvm.org/D157926 (cherry picked from commit 760261a3)
-
Piotr Fusik authored
Also `istringstream::str()` and `ostringstrem::str()`. https://github.com/llvm/llvm-project/issues/40363 causes `str()` to be dllimport'ed despite _LIBCPP_HIDE_FROM_ABI. This is a temporary solution until #40363 is fixed. Reviewed By: #libc, thakis, philnik Differential Revision: https://reviews.llvm.org/D157602 (cherry picked from commit 090996f4)
-
Matt Arsenault authored
Mirror of the previous log changes, OpenCL conformance doesn't like interpreting afn as ignore denormal handling but was previously hidden by flag dropping. (cherry picked from commit 81b278e6)
-
Matt Arsenault authored
OpenCL conformance didn't like interpreting afn as ignore the denormal handling. https://reviews.llvm.org/D157940 (cherry picked from commit 4b7b4b94)
-
Matt Arsenault authored
Apparently afn doesn't allow you to drop the denormal handling according to OpenCL conformance. This was hidden by losing the flags during the library linking process. Fast log is still broken and needs more work. https://reviews.llvm.org/D157936 (cherry picked from commit e09b3593)
-