- May 30, 2024
-
-
Craig Topper authored
These can be implemented with multiple vnclips.
-
Craig Topper authored
Similar to #93596, this moves the signed vnclip patterns into DAG combine. This will allows us to support more than 1 level of truncate in a future patch. -
Fangrui Song authored
Follow-up to a previous simplification 2473b1af. The xor difference between a SHT_NOTE and a read-only SHT_PROGBITS (previously >=NOT_SPECIAL) should be smaller than RF_EXEC. Otherwise, for the following section layout, `findOrphanPos` would place .text before note. ``` // simplified from linkerscript/custom-section-type.s non orphans: progbits 0x8060c00 NOT_SPECIAL note 0x8040003 orphan: .text 0x8061000 NOT_SPECIAL ```
-
David Blaikie authored
-
Craig Topper authored
Reviewed as part of #93728.
-
Shubham Sandeep Rastogi authored
This patch uses `DIExpression::foldConstantMath()` at the result of a Salvaged expression, that is, it runs the folding optimizations after an expression has been salvaged completely, to reduce how many times the fold optimization function is called. Which should help in reducing the size of DIExpressions that grow because of salvaging debug info After checking the size of the dSYM with and without this change, I saw a decrease of about 300KB, where the debug_loc section is about 1.6 GB in size. Where the debug loc section reduced in size by 212KB and it is 193MB in size, the rest comes from the debug_info section This is part of a stack of patches and comes after: https://github.com/llvm/llvm-project/pull/69768 https://github.com/llvm/llvm-project/pull/71717 https://github.com/llvm/llvm-project/pull/71718 https://github.com/llvm/llvm-project/pull/71719
-
Shubham Sandeep Rastogi authored
This patch uses `DIExpression::foldConstantMath()` at the end of a `DIExpression::append()`. Which should help in reducing the size of DIExpressions that grow because of salvaging debug info This is part of a stack of patches and comes after: https://github.com/llvm/llvm-project/pull/69768 https://github.com/llvm/llvm-project/pull/71717 https://github.com/llvm/llvm-project/pull/71718
-
Florian Mayer authored
These are equivalent to the tests in HWASan of the same name.
-
Shubham Sandeep Rastogi authored
DIExpressions can get very long and have a lot of redundant operations. This function uses simple pattern matching to fold constant math that can be evaluated at compile time. The hope is that other people can contribute other patterns as well. I also couldn't see a good way of combining this with `DIExpression::constantFold` so it stands alone. This is part of a stack of patches and comes after https://github.com/llvm/llvm-project/pull/69768 https://github.com/llvm/llvm-project/pull/71717
-
Craig Topper authored
For each pair of types, we had 3 identical tests using umin with the unsigned max value. This patch replaces two of them with smin+smax cases that can be implemented with a signed vmax followed by a vnclipu.
-
Jun Wang authored
Current, if an image_atomic instruction has the 'tfe' operand, the llvm-mc assembler in general would reject it. The only exception is when dmask is 0x1 and the instruction is not image_atomic_cmpswap (e.g., image_atomic_add v[5:6], v252, s[8:15] dmask:0x1 tfe). This patch fixes this problem and allows tfe to be specified in image_atomic instructions. --------- Co-authored-by:Jun Wang <jun.wang7@amd.com>
-
Evgenii Kudriashov authored
* Add support for G_LOAD from G_CONSTANT_POOL on X86 and X64 * Add X86GlobalBaseRegPass to handle base register initialization for X86. * Fix vector type legalization for G_STORE and G_LOAD as well as enable scalarization for them. * Custom lower G_BUILD_VECTOR into G_LOAD from G_CONSTANT_POOL.
-
Shubham Sandeep Rastogi authored
Add functions peekNextN(unsigned) and assignNewExpr(ArrayRef<uint64_t>) to DIExpressionCursor (#71717) This commit adds two functions to the DIExpressionCursor class. `peekNextN(unsigned)` works like peekNext, but lets you peek the next Nth element `assignNewExpr(ArrayRef<uint64_t>)` lets you assign a new expression to the same DIExpressionCursor object This is part of a stack of patches, it comes after https://github.com/llvm/llvm-project/pull/69768 -
Shubham Sandeep Rastogi authored
This is an NFC patch to move DIExpressionCursor to DebugInfoMetada.h, so that it can be used by classes in that header file. Specifically, I want to use DIExpressionCursor in a subsequent patch: https://github.com/llvm/llvm-project/pull/71718
-
Florian Mayer authored
-
Mehdi Amini authored
Flang triggers some OOM on Windows CI right now. This is disruptive to MLIR and LLVM changes that don't touch Flang, as such we disable building Flang on Windows only for these PR that don't touch flang. The testing on Linux is unchanged, and the post-merge Windows testing is still fully covering here.
-
Florian Mayer authored
-
William Junda Huang authored
Add option to generate additional debug info for expression dereferencing pointer to pointers. (#81545) Such expression does not correspond to a variable in the source code thus does not have a debug location. When the user collects perf data on the program, if the intermediate memory load instruction is sampled, it could not be attributed to any variable/class member, which causes the sampling results to be under-counted. This patch adds an option `-fdebug_info_for_pointer_type` to generate a psuedo variable and its debug info for intermediate expression with pointer dereferencing, so that perf data collected on the instruction of that expression can be attributed to the correct class member. This is a prototype so comments are needed.
-
Fangrui Song authored
... as flags have changed. This allows us to revisit the `osd->osec.hasInputSections` condition in `getRankProximity` (originally introduced as `Sec->Live` in https://reviews.llvm.org/D61197).
-
Igor Kudrin authored
Without a linker script, `--orphan-handling=error` or `=warn` reports all input sections, including even well-known sections like `.text`, `.bss`, `.dynamic`, or `.symtab`. However, in this case, no sections should be considered orphans because they all are placed with the same default rules. This patch suppresses errors/warnings for placing orphan sections if no linker script with the `SECTIONS` command is provided. The proposed behavior matches GNU gold. GNU ld in the same scenario only reports sections that are not in its default linker script, thus, it avoids complaining about `.text` and similar.
-
Kazu Hirata authored
This patch fixes: llvm/include/llvm/Analysis/LoopAccessAnalysis.h:381:8: error: no template named 'variant' in namespace 'std'
-
Jonas Devlieghere authored
Remove setupterm workaround on macOS which caused an issues after the removal of the terminfo dependency. There's a comment that explains why the workaround is present, but neither Jim nor I were able to reproduce the issue by setting TERM to vt100.
-
Florian Hahn authored
This avoids unnecessarily passing a number of parameters, and avoids needing to add extra parameters in the future.
-
David Blaikie authored
Complete C++ type information can be quite expensive - and there's limited value in representing every member function, even those that can't be called (we don't do similarly for every non-member function anyway). So add a flag to opt out of this behavior for experimenting with this more terse behavior. I think Sony already does this by default, so perhaps with a change to the defaults, Sony can migrate to this rather than a downstream patch. This breaks current debuggers in some expected ways - but those breakages are visible without this feature too. Consider member function template instantiations - they can't be consistently enumerated in every translation unit: a.h: ``` struct t1 { template <int i> static int f1() { return i; } }; namespace ns { template <int i> int f1() { return i; } } // namespace ns ``` a.cpp: ``` void f1() { t1::f1<0>(); ns::f1<0>(); } ``` b.cpp: ``` void f1(); int main() { f1(); t1::f1<1>(); ns::f1<1>(); } ``` ``` (gdb) p ns::f1<0>() $1 = 0 (gdb) p ns::f1<1>() $2 = 1 (gdb) p t1::f1<0>() Couldn't find method t1::f1<0> (gdb) p t1::f1<1>() $3 = 1 (gdb) s f1 () at a.cpp:3 3 t1::f1<0>(); (gdb) p t1::f1<0>() $4 = 0 (gdb) p t1::f1<1>() Couldn't find method t1::f1<1> (gdb) ``` (other similar non-canonical features are implicit special members (copy/move ctor/assignment operator, default ctor) and nested types (eg: pimpl idiom, where the nested type is declared-but-not-defined in one TU, and defined in another TU)) lldb can't parse the template expressions above, so I'm not sure how to test it there, but I'd guess it has similar problems. ( https://stackoverflow.com/questions/64602475/how-to-print-value-returned-by-template-member-function-in-gdb-lldb-debugging so... I guess that's just totally not supported in lldb, how unfortunate. And implicit special members are instantiated implicitly by lldb, so missing those doesn't tickle the same issue) Some very rudimentary numbers for a clang debug build: .debug_info section size: -g: 476MiB -g -fdebug-types-section: 357MiB -g -gomit-unreferenced-members: 340MiB Though it also means a major reduction in .debug_str size, -fdebug-types-section doesn't reduce string usage (so the first two examples have the same .debug_str size, 247MiB), down to 175MiB. So for total clang binary size (I don't have a quick "debug section size reduction" on-hand): 1.45 (no type units) GiB -> 1.34 -> 1.22, so it saves about 120MiB of binary size. Also open to any riffing on the flag name for sure. @probinson - would this be an accurate upstreaming of your internal handling/would you use this functionality? If it wouldn't be useful to you, it's maybe not worth adding upstream yet - not sure we'll use it at Google, but if it was useful to you folks and meant other folks could test with it it seemed maybe useful. Original Differential Revision: https://reviews.llvm.org/D152017 -
S. Bharadwaj Yadavalli authored
Add an initial design document for TableGen specification of DXIL Operations.
-
gulfemsavrun authored
Reverts llvm/llvm-project#87550 because it broke `TestDAP*` lldb tests. https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64-rbe/b8746585790559468897/overview
-
Florian Hahn authored
This reduces the need for explicitly passing it through multiple layers of function calls.
-
Mircea Trofin authored
Odd indenting.
-
Luke Lau authored
-
Mehdi Amini authored
Reverts llvm/llvm-project#93595 This broke the gcc-7 bot.
-
PiJoules authored
This reverts commit 7832769d. This was reverted prior due to a test failure on the windows builder. I think this was because we didn't specify the triple and assumed windows. The other tests use the full triple specifying linux, so we follow suite here. --- We are using PLTs for cortex-m33 which only supports thumb. More specifically, this is for a very restricted use case. There's no MMU so there's no sharing of virtual addresses between two processes, but this is fine. The MCU is used for running [chre nanoapps](https://android.googlesource.com/platform/system/chre/+/HEAD/doc/nanoapp_overview.md) for android. Each nanoapp is a shared library (but effectively acts as an executable containing a test suite) that is loaded and run on the MCU one binary at a time and there's only one process running at a time, so we ensure that the same text segment cannot be shared by two different running executables. GNU LD supports thumb PLTs but we want to migrate to a clang toolchain and use LLD, so thumb PLTs are needed.
-
PiJoules authored
Prior, the reltable we create was "reltable." + FuncName which can result in multiple tables named "reltable." + FuncName + ".{number}" if we substitute multiple tables in a function. Since we replace the original global, it makes it easier to just take over the original global's name. Functionally, this doesn't change the IR emitted, just global names. This is a subset of PR 93355 that I'm breaking into multiple patches. -
Luke Lau authored
So we don't have to thread through some common arguments, and to allow some methods to access state in an upcoming patch.
-
Mingming Liu authored
- `llvm/**/ProfileData/**/*` intends to cover `llvm/include/llvm/ProfileData/` and `llvm/lib/ProfileData/` - `llvm/**/SampleProfile*` intends to cover a bunch of SamplePGO files and their headers. For example, `SampleProfile.cpp`, `SampleProfileMatcher.cpp`, `SampleProfileProbe.cpp` - `llvm/**/CodeGen/MIRSampleProfile*` intends to cover MIRSampleProfile.cpp and its header. - `llvm/test/Transforms/SampleProfile/**/*` intends to cover unit tests. -
Luke Lau authored
The VNInfo id (called val no elsewhere it seems) and register is enough to uniquely identify AVL values, so try to store as little state as possible. This may also allow us to use dummy val nos in an upcoming patch when we don't have LiveIntervals.
-
Valentin Clement (バレンタイン クレメン) authored
MLIR LLMArrayType is using `unsigned` for the number of elements while LLVM ArrayType is using `uint64_t` https://github.com/llvm/llvm-project/blob/4ae896fe979b7db501cabde4b6b3504478958682/llvm/include/llvm/IR/DerivedTypes.h#L377 This leads to silent truncation when we use it for globals in flang. ``` program test integer(8), parameter :: large = 2**30 real, dimension(large) :: bigarray common /c/ bigarray bigarray(999) = 666 end ``` The above program would result in a segfault since the global would be of size 0 because of the silent truncation. ``` fir.global common @c_(dense<0> : vector<4294967296xi8>) : !fir.array<4294967296xi8> ``` became ``` llvm.mlir.global common @c_(dense<0> : vector<4294967296xi8>) {addr_space = 0 : i32} : !llvm.array<0 x i8> ``` This patch updates the definition of MLIR ArrayType to take `uint64_t` as argument of the number of elements to be compatible with LLVM.
-
Florian Mayer authored
In the reverted change, the order of the IR was dependent on the host compiler, because we inserted instructions in arguments to functions. Fix that, and also fix another problem with the test. This reverts commit 3313f288.
-
Matt Arsenault authored
This was only preserving the flags on the setcc, not the new select. This was missing presumably due to getSelect not having a flags argument until recently. Avoids regressions in a future commit.
-
Matheus Izvekov authored
This patch improves the preservation of qualifiers and loss of type sugar in TemplateNames. This problem is analogous to https://reviews.llvm.org/D112374 and this patch takes a very similar approach to that patch, except the impact here is much lesser. When a TemplateName was written bare, without qualifications, we wouldn't produce a QualifiedTemplate which could be used to disambiguate it from a Canonical TemplateName. This had effects in the TemplateName printer, which had workarounds to deal with this, and wouldn't print the TemplateName as-written in most situations. There are also some related fixes to help preserve this type sugar along the way into diagnostics, so that this patch can be properly tested. - Fix dropping the template keyword. - Fix type deduction to preserve sugar in TST TemplateNames.
-
Craig Topper authored
I plan to add support for multiple layers of vnclipu. For example, i32->i8 using 2 vnclipu instructions. First clipping to 65535, then clipping to 255. Similar for signed vnclip. This scales poorly if we need to add patterns with 2 or 3 truncates. Instead, move the code to DAGCombiner with new ISD opcodes to represent VCLIP(U). This patch just moves the existing patterns into DAG combine. Support for multiple truncates will as a follow up. A similar patch series will be made for the signed vnclip.
-