- Feb 08, 2024
-
-
Arthur Eubanks authored
-
Arthur Eubanks authored
OpFlag and WrapperKind should be chosen consistently with each other in regards to PIC, otherwise we hit asserts later on. Broken by c04a05d8. Fixes #80831.
-
Arthur Eubanks authored
With the legacy pass manager, MachineModuleInfoWrapperPass owned the MachineModuleInfo used in the codegen pipeline. It can do this since it's an ImmutablePass that doesn't get invalidated. However, with the new pass manager, it is legal for the ModuleAnalysisManager to clear all of its analyses, regardless of if the analysis does not want to be invalidated. So we must move ownership of the MachineModuleInfo outside of the analysis (this is similar to PassInstrumentation). For now, make the PassBuilder user register a MachineModuleAnalysis that returns a reference to a MachineModuleInfo that the user owns. Perhaps we can find a better place to own the MachineModuleInfo to make using the codegen pass manager less cumbersome in the future.
-
Yingwei Zheng authored
This patch removes some bitwise folds that fail to check the one-use constraint on the operands. See also the comments https://github.com/llvm/llvm-project/pull/77231#issuecomment-1904090035.
-
Tom Stellard authored
This was broken by 1a642606.
-
Daniel Chen authored
[Flang] Use specific symbol rather than generic symbol as procInterface to declare procedure pointer. (#80738) Flang crashes when lowering the type of `p1` with the following code. The problem is when it sets up the `procInterface`, it uses the generic symbol `int`, not the specific `int`. This PR is to correct that. ``` INTERFACE Int integer FUNCTION Int(arg) integer :: arg END FUNCTION END INTERFACE integer :: res procedure(int), pointer :: p1 p1 => int res = p1(4) end ``` -
Jeremy Morse authored
We originally thought that printing the DPMarker pointer after each instruction was going to be useful, but it turns out it only serves to generate spurious test output differences now. As it stands, the cannonical way to debug RemoveDIs metadata is "dumpDbgValues".
-
Craig Topper authored
This gives the target a chance to keep an atomicrmw op that is smaller than the minimum cmpxchg size. This is needed to support the Zabha extension for RISC-V which provides i8/i16 atomicrmw operations, but does not provide an i8/i16 cmpxchg or LR/SC instructions. This moves the widening until after the target requests LLSC/CmpXChg/MaskedIntrinsic expansion. Once we widen, we call shouldExpandAtomicRMWInIR again to give the target another chance to make a decision about the widened operation. I considered making the targets return AtomicExpansionKind::Expand or a new expansion kind for And/Or/Xor, but that required the targets to special case And/Or/Xor which they weren't currently doing.
-
Craig Topper authored
This code appears to be a hack to set the features to include compressed instructions if the ELF EFLAGS flags bit is present, but the ELF attribute for the ISA string is no present or not accurate. We can't remove the hack because llvm-mc doesn't create ELF attributes by default so a lot of tests fail to disassembler properly. Using clang as the assembler does set the attributes. This patch changes the hack to only set Zca since that is the minimum implied by the flag. Setting anything else potentially conflicts with the ISA string containing Zcmp or Zcmt. JITLink also needs to be updated to recognize Zca in addition to C.
-
Yingwei Zheng authored
Fiix buildbot failures.
-
- Feb 07, 2024
-
-
Nikita Popov authored
-
Jay Foad authored
The aim is to share definitions for all architectures that have the same instruction (ignoring renaming) with the same opcode. Overall this saves about 60 lines of tablegen.
-
Michael Maitland authored
This function can be called from buildCopyToRegs where at least one of the types is a scalable vector type. This function crashed because it did not know how to handle scalable vector types. This patch extends the functionality of getGCDType to handle when at least one of the types is a scalable vector. getGCDType between a fixed and scalable vector is not implemented since the docstring of the function explains that getGCDType is used to build MERGE/UNMERGE instructions and we will never build a MERGE/UNMERGE between fixed and scalable vectors. --------- Co-authored-by:Matt Arsenault <arsenm2@gmail.com>
-
Jeremy Morse authored
We've been building and testing this no-debug-intrinsic work inside of the pass manager for a while, so that optimisation passes get exercised and tested when we turn it on. However, by converting to the non-intrinsic form in the bitcode loader, we accidentally caused all parts of LLVM to potentially see non-intrinsic debug-info. Seeing how we're trying to turn things on incrementally, it was a mistake to go this far this fast: we can instead just focus on enabling during optimisations for the moment, then all the other parts of LLVM later.
-
Yingwei Zheng authored
This patch canonicalizes floating-point comparisons with inf: ``` fcmp olt X, +inf -> fcmp one X, +inf fcmp ole X, +inf -> fcmp ord X, 0 fcmp ogt X, +inf -> false fcmp oge X, +inf -> fcmp oeq X, +inf fcmp ult X, +inf -> fcmp une X, +inf fcmp ule X, +inf -> true fcmp ugt X, +inf -> fcmp uno X, 0 fcmp uge X, +inf -> fcmp ueq X, +inf fcmp olt X, -inf -> false fcmp ole X, -inf -> fcmp oeq X, -inf fcmp ogt X, -inf -> fcmp one X, -inf fcmp oge X, -inf -> fcmp ord X, 0 fcmp ult X, -inf -> fcmp uno X, 0 fcmp ule X, -inf -> fcmp ueq X, -inf fcmp ugt X, -inf -> fcmp une X, -inf fcmp uge X, -inf -> true ``` Alive2: https://alive2.llvm.org/ce/z/FRqqDg The motivation of this patch is to fix the regression found in https://github.com/dtcxzyw/llvm-opt-benchmark/pull/199#discussion_r1480974120.
-
Timm Bäder authored
-
Uday Bondhugula authored
NFC. Fix remaining clang-tidy warnings in AffineExpr.cpp.
-
Timm Bäder authored
-
Jeremy Morse authored
This should be the final portion of shaping-up the test suite to be ready for turning on non-intrinsic debug-info: * Pin CostModel tests that expect to see intrinsics in their -debug output to not use RemoveDIs. This is a spurious test output difference. * Add 'tail' to a bunch of intrinsics in UpdateTestChecks. We're cannonicalising intrinsics to be printed with "tail" in RemoveDI conversion as dbg.values usually pick that up while being optimised. This is another spurious output difference. * The "DebugInfoDrop" pass used in the debugify unit-tests happens to operate inside the pass manager, thus it sees non-intrinsic debug-info. Update it to correctly drop it.
-
Timm Bäder authored
-
Joseph Huber authored
Summary: The standard GPU compilation process embeds each intermediate object file into the host file at the `.llvm.offloading` section so it can be linked later. We also use a special section called something like `omp_offloading_entries` to store all the globals that need to be registered by the runtime. The linker-wrapper's job is to link the embedded device code stored at this section and then emit code to register the linked image and the kernels and globals in the offloading entry section. One downside to RDC linking is that it can become quite big for very large projects that wish to make use of static linking. This patch changes the support for relocatable linking via `-r` to support a kind of "partial" RDC compilation for offloading languages. This primarily requires manually editing the embedded data in the output object file for the relocatable link. We need to rename the output section to make it distinct from the input sections that will be merged. We then delete the old embedded object code so it won't be linked further. We then need to rename the old offloading section so that it is private to the module. A runtime solution could also be done to defer entries that don't belong to the given GPU executable, but this is easier. Note that this does not work with COFF linking, only the ELF method for handling offloading entries, that could be made to work similarly. Given this support, the following compilation path should produce two distinct images for OpenMP offloading. ``` $ clang foo.c -fopenmp --offload-arch=native -c $ clang foo.c -lomptarget.devicertl --offload-link -r -o merged.o $ clang main.c merged.o -fopenmp --offload-arch=native $ ./a.out ``` Or similarly for HIP to effectively perform non-RDC mode compilation for a subset of files. ``` $ clang -x hip foo.c --offload-arch=native --offload-new-driver -fgpu-rdc -c $ clang -x hip foo.c -lomptarget.devicertl --offload-link -r -o merged.o $ clang -x hip main.c merged.o --offload-arch=native --offload-new-driver -fgpu-rdc $ ./a.out ``` One question is whether or not this should be the default behavior of `-r` when run through the linker-wrapper or a special option. Standard `-r` behavior is still possible if used without invoking the linker-wrapper and it guaranteed to be correct.
-
Sirraide authored
Trying to compile a C-style variadic member function with an explicit object parameter was crashing in Sema because of an out-of-bounds access. This fixes #80971.
-
Stephen Tozer authored
Reverted due to buildbot failures resulting from failed compile due to a missing brace error that got into the original commit. This reverts commit 0aacd44a.
-
Shourya Goel authored
Updated the error message to use the proper prefix when no expected directives are found by changing the hard coded expected in the message to a dynamic value in two error messages. Fixes #58290
-
Simon Pilgrim authored
[X86] X86FixupVectorConstants.cpp - update comment to describe all the constant load ops performed by the pass
-
Simon Pilgrim authored
-
Stephen Tozer authored
This patch modifies `SpeculativeExecutionPass::considerHoistingFromTo` to treat DPValues the same way that it treats debug intrinsics, which is to hoist them iff all of their instruction operands within the FromBlock are also being hoisted. This is probably not the ideal behaviour, which would be to not hoist debug info at all in this case, but this patch simply ensures that DPValue behaviour is consistent with debug intrinsic behaviour rather than trying to create new functional changes.
-
Yingwei Zheng authored
This patch tries to invert phi nodes if all incoming values are either constants or nots.
-
Timm Bäder authored
We previously aborted compilation when seeing one of them. Ignore them instead, they have no effect on the generated bytecode.
-
Dmitri Gribenko authored
-
Stephen Tozer authored
Ensure that when a constant value dies, all ValueAsMetadata uses of that constant in a DebugValueUser will be replaced with a PoisonValue instead of a nullptr. This has little visible effect currently, as any nullptr metadata uses in a DebugValueUser would be converted to an empty MDNode in the end anyway, but this patch adds an assert that would be triggered by two existing tests without the functional component of this patch: llvm/test/Transforms/Inline/delete-function-with-metadata-use.ll llvm/test/DebugInfo/X86/array2.ll
-
Yingwei Zheng authored
This patch introduces a matching helper `m_ElementWiseBitCast`, which is used for matching element-wise int <-> fp casts. The motivation of this patch is to avoid duplicating checks in https://github.com/llvm/llvm-project/pull/80740 and https://github.com/llvm/llvm-project/pull/80414.
-
Jeremy Morse authored
We disabled these extra-special RUNlines due to unexpected interactions between the various things we've been fixing. Re-enable them (they'll run on the llvm-new-debug-iterators buildbot) as they all now pass.
-
Timm Bäder authored
This breaks builders: https://lab.llvm.org/buildbot/#/builders/139/builds/58960
-
Timm Bäder authored
-
Alexey Bataev authored
When doing estimation for vectorization of gathered loads, need to estimate the cost of the pointer (vectorization), as it is done for the actual vectorized loads. Otherwise may be too optimistic about the cost of the gathered loads. Reviewers: preames Reviewed By: preames Pull Request: https://github.com/llvm/llvm-project/pull/80867
-
Timm Bäder authored
We need to account for the InitMapPtr here. This is NFC right now since no test is affected by it.
-
Nikita Popov authored
-
Jeremy Morse authored
As we'll hopefully move away from using intrinsics for debug-info shortly, this commit stabilizes a few tests to avoid spurious changes in the process. Briefly, there are differences in output when we don't use intrinsics that we're going to suppress in case we have to revert, these are: * The attributor test gets different attributes for the dbg.value intrinsic because it's not present during optimisation. This has no functional effect and there's no need to test for it. * The Scalarizer test exposes a "debug-info affects codegen" problem, but fixing it is fiddly (updating 20 IRBuilder object calls). Pin this test to not change with RemoveDIs, we can relax it later and get the correct behaviour. * DIDefaultTemplateParam.ll tests for explicit metadata node numbers which is generally bad. Add explicit node-number capturing CHECK lines.
-
Simon Pilgrim authored
Test all combos of avx1/avx2 and prefer-movmsk-over-vtest
-