- Feb 09, 2024
-
-
Diana Picus authored
At the moment, the emergency spill slot is a fixed object for entry functions and chain functions, and a regular stack object otherwise. This patch adopts the latter behaviour for entry/chain functions too. It seems this was always the intention [1] and it will also save us a bit of stack space in cases where the first stack object has a large alignment. [1] https://github.com/llvm/llvm-project/commit/34c8b835b16fb3879f1b9770e91df21883356bb6
-
jeanPerier authored
Runtime derived type info contains information to tell the runtime if some argument in a user defined assignment must be passed with a descriptor or not. This information was not properly build, it would tell the runtime that TARGET argument must be passed via descriptor, which is incorrect. Share the logic between lowering and runtime info generation to determine if an argument must be passed by descriptor or not.
-
David Green authored
This is a fix for #80818, as pointed out in #81144 it should be checking the abs of Scale. The added test changes from NoAlias to MayAlias.
-
Craig Topper authored
We need explicitly cast to XLenVT to avoid tablegen picking i32. If the SelectionDAG scheduler is used it can't find a register class for i32 if i32 isn't a legal type. Fixes #81192, but I might have missed some patterns.
-
Quentin Dian authored
Fixes #79718. Fixes #71178. The same instructions may exist in an iteration. We cannot immediately delete instructions in `ErasedInstrs`.
-
Craig Topper authored
-
Craig Topper authored
If cm.push saves s10, it must also save s11 due to an encoding limitation. We handle this in the code, but had no test for it.
-
Abinaya Saravanan authored
Skip RDF optimizations if a function contains a number of basic blocks that is more than a limit --------- Co-authored-by:Yashas Andaluri <quic_yandalur@quicinc.com>
-
Fangrui Song authored
-
Valentin Clement (バレンタイン クレメン) authored
Lower CUDA attribute for simple dummy argument. This is done in a similar way than `TARGET`, `OPTIONAL` and so on. This patch also move the `Fortran::common::CUDADataAttr` to `fir::CUDAAttributeAttr` mapping to `flang/include/flang/Optimizer/Support/Utils.h` so that it can be reused where needed.
-
Joseph Huber authored
Summary: The `__nvvm_reflect` function is used to guard invalid code that varies between architectures. One problem with this feature is that if it is used without optimizations, it will leave invalid code in the module that will then make it to the backend. The `__nvvm_reflect` pass is already mandatory, so it should do some trivial branch removal to ensure that constants are handled correctly. This dead branch elimination only works in the trivial case of a compare on a branch and does not touch any conditionals that were not realted to the `__nvvm_reflect` call in order to preserve `O0` semantics as much as possible. This should allow the following to work on NVPTX targets ```c int foo() { if (__nvvm_reflect("__CUDA_ARCH") >= 700) asm("valid;\n"); } ``` Relanding after fixing a bug. -
Abdurrahman Akkas authored
Introduced in 76ce4736
-
Fangrui Song authored
Notably, test that --ro-rosegment with a linker script may unnecessarily make a read-only PT_LOAD executable.
-
Alexey Z authored
Previously, `InsertSliceOpSourceCastInserter` was incorrectly applied to a case when tensor types have an encoding attribute attached to them. The type `newSrcType` was missing that attribute from the old `srcType`, which made the expression `srcType == newSrcType` false, since `tensor<2x2xf32, "foo">` is not equal to `tensor<2x2xf32>`. That lead to an endless back and forth between `InsertSliceOpSourceCastInserter` that would introduce a cast and `InsertSliceOpCastFolder` that would remove it right after.
-
lntue authored
[libc] Only declare float128 math functions in the generated math.h if float128 type is supported. (#81010)
-
Lang Hames authored
The error check should be performed after the iterator increment, not before it. Thanks to @dcb314 for catching this! Fixes github.com/apple/swift/issues/81119
-
Felipe de Azevedo Piovezan authored
A line table whose sole entry is an end sequence should not have the entry's file index verified, as that value corresponds to the initial value of the state machine, not to a real file index. In DWARF 5, this is particularly problematic as it uses 0-based indexing, and the state machine specifies a starting index of 1; in other words, you'd need to have _two_ files before such index became legal "by default". A previous attempt to fix this problem was done [1], but it was too specific in its condition, and did not capture all possible cases where this issue can happen. [1]: https://github.com/llvm/llvm-project/pull/77004
-
David Blaikie authored
Derived from this discussion: https://discourse.llvm.org/t/prs-without-approvals-muddy-the-waters/76656
-
Valentin Clement authored
Fix buildbot failing because of missing HLFIRTypes.h.inc
-
Joseph Huber authored
This reverts commit 9211e67d. Summary: This seemed to crash one one of the CUDA math tests. Revert until it can be fixed.
-
-
Joseph Huber authored
Summary: Currently, the linker wrapper sorts input files into different link jobs according to their architectures. Here we assume each architecture is a unique and incompatible link job unless they are specifically marked compatible. This patch simply adds an `all` target to represent an architecture that should be linked against every single other architecture. This will be useful for modelling generic IR such as the ROCm device libraries or the NVPTX libdevice.
-
Joseph Huber authored
Summary: The `__nvvm_reflect` function is used to guard invalid code that varies between architectures. One problem with this feature is that if it is used without optimizations, it will leave invalid code in the module that will then make it to the backend. The `__nvvm_reflect` pass is already mandatory, so it should do some trivial branch removal to ensure that constants are handled correctly. This dead branch elimination only works in the trivial case of a compare on a branch and does not touch any conditionals that were not realted to the `__nvvm_reflect` call in order to preserve `O0` semantics as much as possible. This should allow the following to work on NVPTX targets ```c int foo() { if (__nvvm_reflect("__CUDA_ARCH") >= 700) asm("valid;\n"); } ``` -
Alex MacLean authored
The current implementation of aliases tries to remove all the aliases in the module to prevent the generic version of `AsmPrinter` from emitting them incorrectly. Unfortunately, if the aliases are used this will fail. Instead let's override the function to print aliases directly. In addition, the declarations of the alias functions must occur before the uses. To fix this we emit alias declarations as part of `emitDeclarations` and only emit the `.alias` directives at the end (where we can assume the aliasee has also already been declared).
-
Valentin Clement (バレンタイン クレメン) authored
The custom printer for `fir.global` was eluding all the attributes present on the op when printing the attribute dictionary. So any attribute that is not part of the pretty printing was therefore discarded. This patch fix the printer and also make use of the getters for the attribute names when they are hardcoded.
-
Jerry Wu authored
Add `scf::wrapWhileLoopInZeroTripCheck` to wrap scf while loop in zero-trip-check.
-
Luke Lau authored
Otherwise we will crash since target intrinsics don't have their types legalized. Let the mgather get legalized first, then do the combine on the legal type. Fixes #81088 Co-authored-by:Craig Topper <craig.topper@sifive.com>
-
Reid Kleckner authored
This code was correct as written prior to C++17, which allowed bases to appear in the initializer list. This was observable by creating non-constant aggregate initialization at file scope in a compound literal, but since that behavior will change soon if we implement support for dynamic initialization, I also added a unit test for `isConstantInitializer`. This fixes at least one part of issue #80510 . --------- Co-authored-by:Aaron Ballman <aaron@aaronballman.com>
-
Davide Italiano authored
-
Maksim Panchenko authored
We run CheckLargeFunctions pass in non-relocation mode to prevent the emission of functions that later could not be written to the output due to their large size. The main reason behind the pass is to prevent the emission of metadata for such functions since this metadata becomes incorrect if the function is left unmodified. Currently, the pass is enabled in non-relocation mode only when debug info output is also enabled. As we emit increasingly more kinds of metadata, e.g. for the Linux kernel, it becomes more challenging to track metadata that needs to be fixed. Hence, I'm enabling the pass to always run in non-relocation mode.
-
NAKAMURA Takumi authored
-
Arthur Eubanks authored
This was missing in the gn build for some reason, causing build errors like http://45.33.8.238/linux/130337/step_4.txt after 3b57b647.
-
Alex MacLean authored
Cleanup some dead variables. In addition, switch to a `MAKE_CASE` macro, similar to other targets, to reduce boilerplate.
-
Craig Topper authored
MCPhysReg is 2 bytes, while Register is 4 bytes.
-
Fangrui Song authored
DWARFLinkerImpl::DWARFLinkerImpl initializes DebugStrStrings/DebugLineStrStrings/CommonSections using GlobalData but GlobalData is initialized after the three members. Move GlobalData before. Fix #81110
-
Timm Bäder authored
-
Derek Schuff authored
Currently symbol info is generated from a linking section or from export names. This PR generates symbols in a WasmObjectFile from the name section as well, which allows tools like objdump and nm to show useful information for more linked binaries. There are some limitations: most notably that we don't assume any particular ABI, so we don't get detailed information about data symbols if the segments are merged (which is the default). Covers most of the desired functionality from #76107
-