- Aug 22, 2023
-
-
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)
-
Nikita Popov authored
We should query the subtarget of the calling function, not of the intrinsic. This probably makes no functional difference (as libcalls are unlikely to vary across subtargets), but fixes minor compile-time regressions from unnecessary subtarget instantiations. Followup to D157567. Differential Revision: https://reviews.llvm.org/D157848 (cherry picked from commit 66bb7521)
-
Matt Arsenault authored
We need a better mechanism for expressing which calls you are allowed to emit and which calls are recognized. This should be applied to the 17 branch. (cherry picked from commit c8cac156)
-
Konstantin Varlamov authored
PSTL contains many pragmas that request loop vectorization, which would produce a warning when the compiler is unable to fulfill the request (if `-Wpass-failed` is enabled). This is normal and expected in some cases, and we don't want `-Werror` to turn that into a compilation failure. Differential Revision: https://reviews.llvm.org/D157145 (cherry picked from commit 1d340250)
-
- Aug 18, 2023
-
-
Paul Walker authored
[SelectionDAG] Use TypeSize variant of ComputeValueVTs to compute correct offsets for scalable aggregate types. Differential Revision: https://reviews.llvm.org/D157872
-
Paul Walker authored
Some prep work to make aggregate loads and stores TypeSize aware.
-
Paul Walker authored
Patch also includes a minor fix to AArch64::isLegalAddressingMode to ensure all scalable types have a suitable bailout.
-
Fraser Cormack authored
The subtarget was unconditionally reporting that SVE was to be used to lower vectors when Neon was unavailable, even when SVE itself was unavailable. This decision leads other parts of the compiler to crash, e.g., when querying SVE vector sizes. Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D158179 (cherry picked from commit c058eb99)
-
- Aug 17, 2023
-
-
Derek Schuff authored
Previously when objcopy generated section headers, it padded the LEB that encodes the section size out to 5 bytes, matching the behavior of clang. This is correct, but results in a binary that differs from the input. This can sometimes have undesirable consequences (e.g. breaking source maps). This change makes the object reader remember the size of the LEB encoding in the section header, so that llvm-objcopy can reproduce it exactly. For sections not read from an object file (e.g. that llvm-objcopy is adding itself), pad to 5 bytes. Reviewed By: jhenderson Differential Revision: https://reviews.llvm.org/D155535 (cherry picked from commit 1b21067c)
-
Craig Topper authored
FRINT was added to matchRoundingOp after this function was written. So FRINT was not tested originally. For vectors, folding this causes us to create a CSR swap that tries to write 7 to FRM. This is an illegal value and will cause the CSR write to fail. While this might be a legal fold we could do, I'm disabling it for now so we can backport to LLVM 17 with the least risk. Differential Revision: https://reviews.llvm.org/D157583 (cherry picked from commit 2df9328f)
-
Nikita Popov authored
Relative to the previous attempt, this also adjusts RegionInfo verification to allow unreachable predecessors. ----- If a block in the CHR region has an unreachable predecessor, then there will be no edge from that predecessor to the newly cloned block. However, a phi node entry for it will be left behind. Make sure that these incoming blocks get dropped as well. Fixes https://github.com/llvm/llvm-project/issues/64594. Differential Revision: https://reviews.llvm.org/D157621 (cherry picked from commit 7e2f1ae7)
-
- Aug 16, 2023
-