- Jul 13, 2023
-
-
Qiongsi Wu authored
`libLTO` currently ignores the `-f[no-]integrated-as` flags. This patch teaches `libLTO` to respect them on AIX. The implementation consists of two parts: # Migrate `llc`'s `-no-integrated-as` option to a codegen option so that the option is available to `libLTO`/`lld`/`gold`. # Teach `clang` to pass `-no-integrated-as` accordingly to `libLTO` depending on the `-f[no-]integrated-as` flags. On platforms other than AIX, the `-f[no-]integrated-as` flags are ignored. Reviewed By: MaskRay, steven_wu Differential Revision: https://reviews.llvm.org/D152924
-
varconst authored
It's no longer necessary to define `_DEBUG` because we use our own internal assertion mechanism in libc++. Differential Revision: https://reviews.llvm.org/D155038
-
Matt Arsenault authored
Improve computeKnownFPClass select handling to cover the case where the condition performs a class test. This allows us to recognize no-nans in cases like: %not.nan = fcmp ord float %x, 0.0 %select = select i1 %not.nan, float %x, float 0.0 Math library code has similar edge case filtering on the inputs and final results. https://reviews.llvm.org/D153089
-
Matt Arsenault authored
Prepare to handle class clamping patterns. Working around some kind of select special casing bug in attributor where computeKnownFPClass is never called on select.
-
Matt Arsenault authored
This is now just a wrapper around computeKnownFPClass.
-
varconst authored
This patch only adds new configuration knobs -- the actual assertions will be added in follow-up patches. Differential Revision: https://reviews.llvm.org/D153902
-
varconst authored
When inserting nodes into a forward list, each new node is allocated but not constructed. The constructor was being called explicitly on the node `value_` but the `next_` pointer remained uninitialized rather than being set to null. This bug is only triggered in the cleanup code if an exception is thrown -- upon successful creation of new nodes, the last incorrect "next" value is overwritten to a correct pointer. This issue was found due to new tests added in https://reviews.llvm.org/D149830. Differential Revision: https://reviews.llvm.org/D152327
-
Tom Eccles authored
hlfir.get_length will not modify the buffer and so it is safe for a hlfir.associate using the same expression buffer not to make its own copy. Differential Revision: https://reviews.llvm.org/D154942
-
Tai Ly authored
Remove Tosa_Tensor1Dto4D and Tosa_TensorUpto4D in the Tosa Dialect and added level checks to TosaValidation pass to validate per spec. Signed-off-by:
Tai Ly <tai.ly@arm.com> Change-Id: Icd32137e9f8051f99994cee9f388f20c1a840f4b Reviewed By: eric-k256 Differential Revision: https://reviews.llvm.org/D154273
-
Nick Desaulniers authored
The `Uses` variable is unnecessary. Just use `UsesNum` instead. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D155020
-
Eduard Zingerman authored
"BTF" is a debug information format used by LLVM's BPF backend. The format is much smaller in scope than DWARF, the following info is available: - full set of C types used in the binary file; - types for global values; - line number / line source code information . BTF information is embedded in ELF as .BTF and .BTF.ext sections. Detailed format description could be found as a part of Linux Source tree, e.g. here: [1]. This commit modifies `llvm-objdump` utility to use line number information provided by BTF if DWARF information is not available. E.g., the goal is to make the following to print source code lines, interleaved with disassembly: $ clang --target=bpf -g test.c -o test.o $ llvm-strip --strip-debug test.o $ llvm-objdump -Sd test.o test.o: file format elf64-bpf Disassembly of section .text: <foo>: ; void foo(void) { r1 = 0x1 ; consume(1); call -0x1 r1 = 0x2 ; consume(2); call -0x1 ; } exit A common production use case for BPF programs is to: - compile separate object files using clang with `-g -c` flags; - link these files as a final "static" binary using bpftool linker ([2]). The bpftool linker discards most of the DWARF sections (line information sections as well) but merges .BTF and .BTF.ext sections. Hence, having `llvm-objdump` capable to print source code using .BTF.ext is valuable. The commit consists of the following modifications: - llvm/lib/DebugInfo/BTF aka `DebugInfoBTF` component is added to host the code needed to process BTF (with assumption that BTF support would be added to some other tools as well, e.g. `llvm-readelf`): - `DebugInfoBTF` provides `llvm::BTFParser` class, that loads information from `.BTF` and `.BTF.ext` sections of a given `object::ObjectFile` instance and allows to query this information. Currently only line number information is loaded. - `DebugInfoBTF` also provides `llvm::BTFContext` class, which is an implementation of `DIContext` interface, used by `llvm-objdump` to query information about line numbers corresponding to specific instructions. - Structure `DILineInfo` is modified with field `LineSource`. `DIContext` interface uses `DILineInfo` structure to communicate line number and source code information. Specifically, `DILineInfo::Source` field encodes full file source code, if available. BTF only stores source code for selected lines of the file, not a complete source file. Moreover, stored lines are not guaranteed to be sorted in a specific order. To avoid reconstruction of a file source code from a set of available lines, this commit adds `LineSource` field instead. - `Symbolize` class is modified to use `BTFContext` instead of `DWARFContext` when DWARF sections are not available but BTF sections are present in the object file. (`Symbolize` is instantiated by `llvm-objdump`). - Integration and unit tests. Note, that DWARF has a notion of "instruction sequence". DWARF implementation of `DIContext::getLineInfoForAddress()` provides inexact responses if exact address information is not available but address falls within "instruction sequence" with some known line information (see `DWARFDebugLine::LineTable::findRowInSeq()`). BTF does not provide instruction sequence groupings, thus `getLineInfoForAddress()` queries only return exact matches. This does not seem to be a big issue in practice, but output of the `llvm-objdump -Sd` might differ slightly when BTF is used instead of DWARF. [1] https://www.kernel.org/doc/html/latest/bpf/btf.html [2] https://github.com/libbpf/bpftool Depends on https://reviews.llvm.org/D149501 Reviewed By: MaskRay, yonghong-song, nickdesaulniers, #debug-info Differential Revision: https://reviews.llvm.org/D149058 -
Nick Desaulniers authored
Rather than open coding the same implementation. Reviewed By: MaskRay, void Differential Revision: https://reviews.llvm.org/D154996
-
Ted Woodward authored
"line 0" in a DWARF linetable means something that doesn't have associated source. The code for mixed disassembly has a comment indicating that "line 0" should be skipped, but the wrong value was returned. Fix the return value and add a test to check that we don't incorrectly show source lines from the beginning of the file. Reviewed By: jasonmolenda Differential Revision: https://reviews.llvm.org/D112931
-
Craig Topper authored
D152023 made ubsan consider __builtin_clz of 0 undefined regardless of the target. This ensures portability and matches gcc. This causes the ACLE intrinsics to also be considered to also be considered to be undefined for 0 since they used the generic builtins as their implementation. This patch adds builtins for ARM that ubsan doesn't know about to make the behavior defined for 0. Alternatively, I could have added a zero check to the intrinsics, but the dedicated builtin will give better -O0 codegen. Fixes #63113. Reviewed By: tmatheson Differential Revision: https://reviews.llvm.org/D154915
-
- Jul 12, 2023
-
-
Matthias Springer authored
Generalize `extractFromI64ArrayAttr` to `extractFromIntegerArrayAttr`, so that arbitrary integer/bool types can be extracted. Differential Revision: https://reviews.llvm.org/D154974
-
Nikolas Klauser authored
Reviewed By: #libc, ldionne Spies: h-vetinari, libcxx-commits Differential Revision: https://reviews.llvm.org/D154913
-
Corentin Jabot authored
This reverts commit b0cc947b. Breaks in presence of asm goto https://reviews.llvm.org/D154696#4493805
-
John Brawn authored
When built without LLVM_ENABLE_ASSERTIONS we can get a warning in ARMExpandPseudoInsts.cpp due to a variable only being used inside of a LLVM_DEBUG statement. Fix this with a dummy use, like we do elsewhere.
-
Amanda Tang authored
Support extra concrete class declarations and definitions under NativeTrait that get injected into the class that specifies the trait. Extra declarations and definitions can be passed in as template arguments for NativeOpTraitNativeAttrTrait and NativeTypeTrait. Usage examples of this feature include: - Creating a wrapper Trait for authoring inferReturnTypes with the OpAdaptor by specifying necessary Op specific declarations and definitions directly in the trait - Refactoring the InferTensorType trait Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D154731
-
Fangrui Song authored
Disassembling needs LLVM_TARGETS_TO_BUILD.
-
Valentin Clement authored
reduction operator min and max are not supported with complex type. Add a proper error so it fails correctly. Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D155016
-
Paul Kirth authored
This came up in This came up in https://reviews.llvm.org/D146776#inline-1489091 and is slightly related to https://reviews.llvm.org/D153855. In both patches, there is the observation that some modifications of the module should not invalidate analysis, such as when adding a declaration or some metadata the won't be used when compiling the current module. This patch implements the suggestion that we should ignore globals that have the `llvm.` prefix when calculating the module hash. Fixes https://github.com/llvm/llvm-project/issues/63590 Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D154019
-
Jingu Kang authored
MachineLICM pass handles inner loops only when outmost loop does not have unique predecessor. If the loop has preheader and there is loop invariant code, the invariant code can be hoisted to the preheader in general. This patch makes the pass handle inner loops in general. Differential Revision: https://reviews.llvm.org/D154205
-
Craig Topper authored
If the operands to the mul have other uses we may be extending their live range past a kill flag. Reviewed By: asb, asi-sc Differential Revision: https://reviews.llvm.org/D155046
-
Craig Topper authored
For RISC-V, getRegisterType for fp16 returns i16. i16->fp64 extload is considered legal because the LoadExtActions defaults to Legal for all entries. Only fp/fp and int/int entries are changed to Expand fore RISC-V. This patch detects the FP-ness has changed and won't try to call isLoadExtLegal. Alternatively, we could add Expand for int/fp and fp/int, but that seemed a little silly. Fixes #63816 Reviewed By: asb, wangpc Differential Revision: https://reviews.llvm.org/D155040
-
Nikita Popov authored
I don't believe this is relevant anymore with opaque pointers, where we always expand the entire offset, without splitting it into parts.
-
Peixin Qiao authored
This folds (a << k) ? 2^k * a : 0 to 2^k * a. https://alive2.llvm.org/ce/z/_dDRjo Fix #62155. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D148420
-
Matthias Springer authored
Do not hoist vector transfers that do not match exactly. In particular, do not hoist transfers with different vector types. This has lead to invalid IR (yielded vector type is different from iter_arg type) in downstream projects. Differential Revision: https://reviews.llvm.org/D155052
-
Jie Fu authored
/Users/jiefu/llvm-project/llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:293:13: error: function 'FactorOutConstant' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] static bool FactorOutConstant(const SCEV *&S, const SCEV *&Remainder, ^ 1 error generated. -
Kevin P. Neal authored
In D146869 @arsenm pointed out that the constrained intrinsics aren't getting the strictfp attribute by default. They should be since they are required to have it anyway. TableGen did not know about this attribute until now. This patch adds strictfp to TableGen, and it uses it on all of the constrained intrinsics. Differential Revision: https://reviews.llvm.org/D154991
-
Nikita Popov authored
This also removes the element type from the descriptor, as it is always i8. The meaning of the step is now the same between integers and pointers.
-
Ivan Kosarev authored
-
Nikita Popov authored
-
Ingo Müller authored
The `static_(num_threads|tile_sizes)` attributes of this op are `DefaultValuedOptionalAttr`s, so they can be constructed *without* such an attribute. In other words, the following is a valid op (note the absense of the `static_num_threads` attribute): "builtin.module"() ({ "transform.sequence"() <{failure_propagation_mode = 1 : i32, operand_segment_sizes = array<i32: 0, 0>}> ({ ^bb0(%arg0: !pdl.operation, %arg1: !transform.op<"linalg.matmul">, %arg2: !transform.op<"linalg.elemwise_binary">): %0 = "transform.structured.match"(%arg0) <{ops = ["test.dummy"]}> : (!pdl.operation) -> !pdl.operation %1:2 = "transform.structured.tile_to_forall_op"(%arg1, %0) <{operand_segment_sizes = array<i32: 1, 0, 0, 0, 1>}> : (!transform.op<"linalg.matmul">, !pdl.operation) -> (!transform.op<"scf.forall">, !transform.op<"linalg.matmul">) "transform.yield"() : () -> () }) : () -> () }) : () -> () However, the custom printing directive converted those to an `ArrayRef`, which crashes if done on an empty `ArrayAttr`. This patch changes the signature such that no automatic conversion takes place and extends the test to test for existinnce of the attribute. Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D155062 -
Jay Foad authored
Record the SP adjustment on entry to each basic block. This is almost always zero except on targets like ARM which can split a basic block in the middle of a call sequence. This simplifies PEI::replaceFrameIndices which previously had to visit basic blocks in a specific order and had special handling for unreachable blocks. More importantly it paves the way for an equally simple implementation of a backwards version of replaceFrameIndices, which is required to fully convert PrologEpilogInserter to backwards register scavenging, which is preferred because it does not rely on accurate kill flags. Differential Revision: https://reviews.llvm.org/D154281
-
Alex Gatea authored
Avoid duplicate calls to setTargetAttributes on global variable definitions. Differential: https://reviews.llvm.org/D153903
-
pvanhout authored
`KnownBits` is also a type name. Having a field with this name prevents derived classes from using the `KnownBits` type unless they use `struct KnownBits`. Reviewed By: foad Differential Revision: https://reviews.llvm.org/D155082
-
Nikita Popov authored
-
Nikita Popov authored
-
Marco Elver authored
https://reviews.llvm.org/D130883 introduced MIMetadata to simplify metadata propagation (DebugLoc and PCSections). However, we're currently still permitting implicit conversion of DebugLoc to MIMetadata, to allow for a gradual transition and let the old code work as-is. This manifests in lost !pcsections metadata for X86-specific lowerings. For example, 128-bit atomics. Fix the situation for X86ISelLowering by converting all BuildMI() calls to use an explicitly constructed MIMetadata. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D154986
-