- Jul 22, 2023
-
-
Fabian Mora authored
Currently, `ROCDL::GridDim*Op` is being translated to `__ockl_get_global_size`, however to match the meaning of `gpu.grid_dim` it should instead be translated to `__ockl_get_num_groups`. This change would also make it agree with the meaning of `gridDimx.*` in HIP, see: https://github.com/ROCm-Developer-Tools/hipamd/blob/develop/include/hip/amd_detail/amd_hip_runtime.h#L257 Difference between the functions: ``` __ockl_get_global_size = blockDim * numBlocks __ockl_get_num_groups = numBlocks ``` Reviewed By: krzysz00 Differential Revision: https://reviews.llvm.org/D156009
-
Benjamin Kramer authored
-
Phoebe Wang authored
Fixes #63017 Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D155952
-
Mark de Wever authored
Implements parts of - P2093R14 Formatted output - P2539R4 Should the output of std::print to a terminal be synchronized with the underlying stream? Depends on D150044 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D155262 -
Fangrui Song authored
-
Matthias Springer authored
`changed` was not updated correctly when it was already set to "true" before calling `applyPatternsAndFoldGreedily`. Differential Revision: https://reviews.llvm.org/D155934
-
Matthias Springer authored
Add a transform that eliminates dead operations. This is useful after certain transforms (such as fusion) that create/clone new IR but leave the original IR in place. Differential Revision: https://reviews.llvm.org/D155954
-
Fangrui Song authored
There is a libstdc++ stl_map.h bug that is only back ported to 7.5. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78595#c13 ``` /tmp/opt/gcc-7.3.0/include/c++/7.3.0/bits/stl_tree.h:2091:28: error: no matching function for call to ‘std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<llvm::vfs::detail::InMemoryNode> >, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<llvm::vfs::detail::InMemoryNode> > >, std::less<std::__cxx11::basic_string<char> >, std::allocator<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<llvm::vfs::detail::InMemoryNode> > > >::_M_get_insert_unique_pos(std::pair<llvm::StringRef, std::unique_ptr<llvm::vfs::detail::InMemoryNode> >::first_type&)’ = _M_get_insert_unique_pos(_KeyOfValue()(__v)); ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ ``` Just construct a std::string from StringRef to work around it.
-
Mehdi Amini authored
Instead of crashing, try to print a useful error message.
-
Valentin Clement authored
Reviewed By: razvanlupusoru Differential Revision: https://reviews.llvm.org/D155897
-
khei4 authored
Revert "Reapply: [MemCpyOpt] implement single BB stack-move optimization which unify the static unescaped allocas" revert because crash on chrome windows https://reviews.llvm.org/D153453#4524256 This reverts commit 569769b6.
-
Nathan Ridge authored
Differential Revision: https://reviews.llvm.org/D154471
-
Fangrui Song authored
When using -fsplit-lto-unit (explicitly specified or due to using -fsanitize=cfi/-fwhole-program-vtables), the emitted LLVM IR contains a module flag metadata `"EnableSplitLTOUnit"`. If a module contains both type metadata and `"EnableSplitLTOUnit"`, `ThinLTOBitcodeWriter.cpp` will write two modules into the bitcode file. Compiling the bitcode (not ThinLTO backend compilation) will lead to an error due to `parseIR` requiring a single module. ``` % clang -flto=thin a.cc -c -o a.bc % clang -c a.bc % clang -fsplit-lto-unit -flto=thin a.cc -c -o a.bc % clang -c a.bc error: Expected a single module 1 error generated. ``` There are multiple ways to have just one module in a bitcode file output: `-Xclang -fno-lto-unit`, not using features like `-fsanitize=cfi`, using `-fsanitize=cfi` with `-fno-split-lto-unit`. I think whether a bitcode input file contains 2 modules (internal implementation strategy) should not be a criterion to require an additional driver option when the user seek for a non-LTO compile action. Let's place the extra module (if present) into CodeGenOptions::LinkBitcodeFiles (originally for -cc1 -mlink-bitcode-file). Linker::linkModules will link the two modules together. This patch makes the following commands work: ``` clang -S -emit-llvm a.bc clang -S a.bc clang -c a.bc ``` Reviewed By: ormris Differential Revision: https://reviews.llvm.org/D154923
-
Richard Smith authored
- When the destination is a final class type that does not derive from the source type, the cast always fails and is now emitted as a null pointer or call to __cxa_bad_cast. - When the destination is a final class type that does derive from the source type, emit a direct comparison against the corresponding base class vptr value(s). There may be more than one such value in the case of multiple inheritance; check them all. For now, this is supported only for the Itanium ABI. I expect the same thing is possible for the MS ABI too, but I don't know what guarantees are made about vfptr uniqueness. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D154658
-
Med Ismail Bennani authored
This patch adds the ability to pass native types from the script interpreter to methods that use a {SB,}StructuredData argument. To do so, this patch changes the `ScriptedObject` struture that holds the pointer to the script object as well as the originating script interpreter language. It also exposes that to the SB API via a new class called `SBScriptObject`. This structure allows the debugger to parse the script object and convert it to a StructuredData object. If the type is not compatible with the StructuredData types, we will store its pointer in a `StructuredData::Generic` object. This patch also adds some SWIG typemaps that checks the input argument to ensure it's either an SBStructuredData object, in which case it just passes it throught, or a python object that is NOT another SB type, to provide some guardrails for the user. rdar://111467140 Differential Revision: https://reviews.llvm.org/D155161 Signed-off-by:Med Ismail Bennani <ismail@bennani.ma>
-
Sunil Srivastava authored
-
Sam McCall authored
Our use case is wanting to apply a spelling strategy to rewrite the spellings written in IWYU pragma private directives. Differential Revision: https://reviews.llvm.org/D155671
-
Felipe de Azevedo Piovezan authored
This rewrites DW_OP_addrx inside DWARFExpression as an DW_OP_addr so that we can update addresses that are originally located in the debug_addr section. The full discussion behind this can be found in https://discourse.llvm.org/t/dwarfexpression-and-dw-op-addrx/71627/12, but a summary follows. When SymbolFileDWARF::ParseVariableDIE creates DWARFExpressions for variables whose location is an OP_addr, it knows how to remap addresses appropriately in the DebugMap case. It then calls DWARFExpression::Update_DW_OP_addr, which updates the value associated with OP_addr. However, when we have an OP_addrx, the update function does nothing. This makes sense, as the DWARFExpression does not have a mutable view of the debug_addr section. In non-DebugMap flows this is not an issue, as the debug_addr contains the correct addresses of variables. In DebugMap flows, this is problematic because the work done by RelinkOSOAddress is lost. By updating the OP to OP_addr, we can also update the address as required, We also explored the alternative of relinking the debug_addr section when we are initializing OSOs (InitOSO). However, this creates an inconsistent story for users of DWARFExpression::GetLocation_DW_OP_addr. This function returns an address without telling callers whether that address came from an OP_addr or an OP_addrx. If we preemptively relink OP_addrx results without doing the same for OP_addr results, then callers can’t know whether the address they got was an executable address or an object file address. In other words, they can’t know whether they need to call LinkOSOFileAddress on those results or not. This patch addresses the majority of test failures when enabling DWARF 5 for MachO (over 200 test failures). Differential Revision: https://reviews.llvm.org/D155198
-
TatWai Chong authored
when operating integer type tensors, tosa elementwise multiplication requires the element type of result to be a 32-bit integer rather than the same type as inputs. Change-Id: Ifd3d7ebd879be5c6b2c8e23aa6d7ef41f39c6d41 Reviewed By: mgehre-amd Differential Revision: https://reviews.llvm.org/D154988
-
Evan Wilde authored
There are some trailing semicolons on namespaces in clang/lib/APINotes/APINotesFormat.h. These result in warnings while building and don't need to be there. Reviewed By: compnerd Differential Revision: https://reviews.llvm.org/D105049
-
Kazu Hirata authored
This patch fixes: llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp:1006:9: error: unused variable 'Ty' [-Werror,-Wunused-variable]
-
Jon Roelofs authored
... since they've always supported it. rdar://104359594 Differential revision: https://reviews.llvm.org/D155988
-
Philip Reames authored
This reverts commit cbf2a6ce. This was a precommited test for a change which is being abandoned.
-
Nathan Chancellor authored
This reverts commit 086ee995. This patch causes an infinite loop when building arch/mips/mm/c-r4k.c in the Linux kernel. See the comment in Phabricator for a reduced reproducer: https://reviews.llvm.org/rG086ee99564afbb11449c08ea2e094f7f49fadde5
-
Matt Arsenault authored
-
Matt Arsenault authored
Extends the new frexp scaled reciprocal to the general case. The reciprocal case is just the same thing when frexp of 1 is constant folded. Could probably clean up the code to rely on that constant folding. Improves results for the IEEE path for the default OpenCL division. We used to only emit the fdiv.fast intrinsic with a 2.5 ulp accuracy threshold with DAZ, which uses explicit range checks. This gives us a better fast option with the default IEEE behavior.
-
Matt Arsenault authored
NFC-ish. Does trigger some reordering of the fdiv scalarization. Also skips scalarizing in more cases where nothing was going to happen. We can still scalarize in some no-op edge cases. https://reviews.llvm.org/D155740
-
Richard Smith authored
Different requesting modules can have different lookup results, so don't cache results across modules. Fixes a regression introduced in reviews.llvm.org/D132779. Test case based on one provided by Jan Svoboda. Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D156000
-
Peter Klausler authored
A semantics check for an assumed-length dummy procedure pointer was inappropriately part of an "else" clause for a preceding check, causing it to not be applied in all situations. Differential Revision: https://reviews.llvm.org/D155975
-
Jakub Kuderski authored
@benvanik reported this as missing. Reviewed By: Mogball Differential Revision: https://reviews.llvm.org/D155907
-
Kirill Stoimenov authored
Reviewed By: brooksmoses, MaskRay Differential Revision: https://reviews.llvm.org/D155994
-
Peter Klausler authored
An attempt to use an edit descriptor (other than A or L) in a FORMAT statement without arequired 'w' width will elicit warnings from both the parser and the I/O checker in semantics. Remove the warning from the parser. Differential Revision: https://reviews.llvm.org/D155977
-
Rafael Ubal Tena authored
- Wrote complete documentation for the `Broadcastable` op trait. This is mostly meant as a thorough description of its previous behavior, with the exception of minor feature updates. - Restricted legality criteria for a `Broadcastable` op in order to simplify current and future lowering passes and increase efficiency of code generated by those passes. New restriction are: 1) A dynamic dimension in an inferred result is not compatible with a static dimension in the actual result. 2) Broadcast semantics are restricted to input operands and not supported between inferred and actual result shapes. - Implemented TOSA-to-Linalg lowering support for unary, binary, tertiary element-wise ops. This support is complete for all legal cases described in the `Broadcastable` trait documentation. - Added unit tests for `tosa.abs`, `tosa.add`, and `tosa.select` as examples of unary, binary, and tertiary ops. Reviewed By: eric-k256 Differential Revision: https://reviews.llvm.org/D153291
-
Philip Reames authored
-
Peter Klausler authored
NORM2 is broken for arrays that start with a negative number because it sets the initial running max_ value to that number rather than to its absolute value. Differential Revision: https://reviews.llvm.org/D155976
-
Jacques Pienaar authored
This allows for converting before/without an Operation is created. Differential Revision: https://reviews.llvm.org/D155996
-
Peter Klausler authored
Add more checks to procedure compatibility testing for procedure pointer assignments, actual procedure arguments, &c. Specifically, don't allow corresponding dummy data objects to differ in their use of polymorphism, assumed size arrays, or assumed shape arrays. Differential Revision: https://reviews.llvm.org/D155974
-
Joseph Huber authored
This patch adds initial support for using aliases when targeting PTX. We perform a pretty strict conversion from the globals referenced to the expected output. as described in the PTX documentation at https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#kernel-and-function-directives-alias These cannot currently be used due to a bug in the `nvlink` implementation that causes aliases to pruned functions to crash the linker. Reviewed By: tra Differential Revision: https://reviews.llvm.org/D155211
-
Peter Klausler authored
A quotation mark can appear in a Fortran character literal by doubling it; for example, PRINT *, "'""'" prints '"'. When those doubled quotation marks are split by a free form line continuation, the continuation line should have an ampersand before the second quotation mark. But most compilers, including this one, allow the second quotation mark to appear as the first character on the continuation line, too. So this works: print *, "'"& "'" but it really should be written as: print *, "'"& &"'" Emit a portability warning and document that we support this near-universal extension. Differential Revision: https://reviews.llvm.org/D155973
-
Sam McCall authored
The special handling for these names was added in https://github.com/llvm/llvm-project/commit/055d8090d1d5137dab88533995e0c5d9b5390c28 and the motivation was the C++ standard library. It turns out some projects like using these names anyway, in particular the linux kernel. D153946 proposed making this a config option, but there are some implementation issues with the config system. As an alternative, this patch tweaks the heuristic so we only drop these symbols in system headers. This does the right thing for linux and the C++ standard library, at least. Fixes https://github.com/clangd/clangd/issues/1680 Fixes https://github.com/llvm/llvm-project/issues/63862 Differential Revision: https://reviews.llvm.org/D155381
-