aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-07-08[𝘀𝗽𝗿] changes introduced through rebaseusers/koachan/spr/main.sparcias-enable-parseforallfeatures-in-matchoperandparserimplKoakuma5995-114540/+447755
Created using spr 1.3.5 [skip ci]
2024-06-27[SPARC][IAS] Rework ASI/Prefetch tag matching in prep for `ParseForAllFeatures`Koakuma3-51/+83
Unify parts of ASI and Prefetch tag matching at `parseASITag` and `parsePrefetchTag` to use a common function to parse any immediate expressions. This introduces a slight regression to error messages, but is needed so we can enable `ParseForAllFeatures` in `MatchOperandParserImpl` in a future patch. Reviewers: jrtc27, brad0, rorth, s-barannikov Reviewed By: s-barannikov Pull Request: https://github.com/llvm/llvm-project/pull/96020
2024-06-27[clang][Interp] Merge ByteCodeExprGen and ByteCodeStmtGen (#83683)Timm Baeder8-1027/+911
We currently cannot generate bytecode for statements once we've decided we want to generate bytecode for expressions. This is a problem for `StmtExpr`, which is an expression that requires us to evaluate a statement. Merge ByteCodeExprGen and ByteCodeStmtGen, so we don't do that distinction anymore. Rename them to Compiler at the same time.
2024-06-27[PassManager] Drop Function.h and Module.h includes (NFC) (#96892)Nikita Popov1-2/+3
Replace them with forward declarations.
2024-06-27[clang][OpenMP] Place some common code in functions (#96811)Krzysztof Parzyszek2-905/+167
There are chunks of code repeated in a number of functions. This patch moves some of that code into individual functions.
2024-06-27[mlir][Ptr] Init the Ptr dialect with the `!ptr.ptr` type. (#86860)Fabian Mora19-0/+646
This patch initializes the `ptr` dialect directories and base files, adding the `!ptr.ptr` type and the `#ptr.spec<...>` data layout spec attribute. The `!ptr.ptr` type is an opaque pointer type optionally parameterized by a memory space. This type typically represents a handle to an object in memory or target-dependent values like `nullptr`. The implementation of the `DataLayoutTypeInterface` interface for `!ptr.ptr` was adapted from `!llvm.ptr`'s implementation. This implementation uses the `#ptr.spec<...>` attribute for defining the data layout specification. See [[RFC] `ptr` dialect & modularizing ptr ops in the LLVM dialect](https://discourse.llvm.org/t/rfc-ptr-dialect-modularizing-ptr-ops-in-the-llvm-dialect/75142) for rationale and roadmap.
2024-06-27[X86] computeKnownBitsForPMADDWD - the final addition of the signextended ↵Simon Pilgrim1-1/+1
multiplies is not guaranteed to be NSW https://rust.godbolt.org/z/3f1bevnoT https://alive2.llvm.org/ce/z/cjixBY Noticed by @alexfh
2024-06-27[Sema] TransformTypeOfExprType / TransformTypeOfType - don't dereference ↵Simon Pilgrim1-2/+2
getAs<> results Use castAs<> to assert the cast is valid to help avoid null dereferences Fixes static analyser warnings
2024-06-27[CodeGen] Mark MachinePostDominatorTree constructor explicit (#96852)paperchalice1-1/+1
Align with PostDominatorTree.
2024-06-27[RICSV] PerformDAGCombine - don't directly dereference dyn_cast resultsSimon Pilgrim1-4/+4
Use cast<> to assert the cast is valid to help avoid null dereferences Fixes static analyser warnings
2024-06-27[Sema] HLSLCompareFloatingRank - don't dereference getAs<> resultsSimon Pilgrim1-2/+2
Use castAs<> to assert the cast is valid to help avoid null dereferences Fixes static analyser warning
2024-06-27[VPlan] Return std::nullopt early if plans are empty.Florian Hahn2-0/+45
Fixes a crash caused by abf5969.
2024-06-27[mlir][vector] Support more mask types in foldTransferFullMask() (#96761)Benjamin Maxwell2-7/+11
Using the existing `getMaskFormat()` this can be extended to support `arith.constant` masks.
2024-06-27[mlir][OpenMP] Standardise representation of reduction clause (#96215)Tom Eccles5-36/+137
Now all operations with a reduction clause have an array of bools controlling whether each reduction variable should be passed by reference or value. This was already supported for Wsloop and Parallel. The new operations modified here currently have no flang lowering or translation to LLVMIR and so further changes are not needed. It isn't possible to check the verifier in mlir/test/Dialect/OpenMP/invalid.mlir because there is no way of parsing an operation to have an incorrect number of byref attributes. The verifier exists to pick up buggy operation builders or in-place operation modification.
2024-06-27[Clang][AST] Let DeclPrinter print trailing requires expressions for ↵Younan Zhang3-0/+25
template parameters (#96864) As discussed in https://github.com/llvm/llvm-project/pull/96084#discussion_r1654629993, it would be nice to present these trailing constraints on template parameters when printing CTAD decls through a DeclPrinter.
2024-06-27[lldb/test] Mark TestStepScripted.py as XFAIL temporarily (#96894)Med Ismail Bennani1-1/+5
After landing 9a9ec228cdcf, some of the `TestStepScripted.py` methods started failing on various bots: - https://lab.llvm.org/buildbot/#/builders/162/builds/851 - https://lab.llvm.org/buildbot/#/builders/59/builds/650 - https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6546/ - https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/3359/ Since I'm not able to reproduce the test failure locally (tested on darwin x86_64/arm64 & linux arm64), I'll mark these as XFAIL until I can reproduce it or attach to a bot to investigate the issue on it directly. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-27[lldb][test] Refactor no target XML testDavid Spickett1-41/+38
To make it more easy to check a bug later.
2024-06-27MathExtras: s/constexpr inline/constexpr/ (NFC) (#96890)Ramkumar Ramachandra1-20/+20
constexpr implies inline.
2024-06-27[PassManager] Add pretty stack frames (#96078)Nikita Popov8-11/+95
In NewPM pass managers, add a "pretty stack frame" that tells you which pass crashed while running which function. For example `opt -O3 -passes-ep-peephole=trigger-crash-function test.ll` will print something like this: ``` Stack dump: 0. Program arguments: build/bin/opt -S -O3 -passes-ep-peephole=trigger-crash-function test.ll 1. Running pass "function<eager-inv>(mem2reg,instcombine<max-iterations=1;no-use-loop-info;no-verify-fixpoint>,trigger-crash-function,simplifycfg<bonus-inst-threshold=1;no-forward-switch-cond;switch-range-to-icmp;no-switch-to-lookup;keep-loops;no-hoist-common-insts;no-sink-common-insts;speculate-blocks;simplify-cond-branch>)" on module "test.ll" 2. Running pass "trigger-crash-function" on function "fshl_concat_i8_i8" ``` While the crashing pass is usually evident from the stack trace, this also shows which function triggered the crash, as well as the pipeline string for the pass (including options). Similar functionality existed in the LegacyPM.
2024-06-27Revert "Revert "[flang] Fix execute_command_line cmdstat is not set when ↵Yi Wu3-51/+171
error occurs" (#96365)" (#96774) The fix broke llvm-test-suite, so it was reverted previously. With test fixes added in https://github.com/llvm/llvm-test-suite/pull/137, it should now pass the tests This reverts commit 435635652fd226fa292abcff6a10d3df9dbd74e3.
2024-06-27[X86] Add phase ordering test coverage for #58895Simon Pilgrim1-0/+574
2024-06-27[CodeGen] Don't write coverage to source directory in testBenjamin Kramer1-1/+1
2024-06-27[NVPTX] Don't use underlying alignment to align param (#96793)Hugh Delaney2-3/+54
Previously, if a ptr had align N, then the NVPTX lowering was taking this align N to refer to the alignment of the pointer type itself, as opposed to the alignment of the memory that it points to. As such, if a kernel with signature ``` define void @foo(ptr align 4 %_arg_ptr) ``` takes align 4 to be the alignment of the parameter, this would result in breaking the ld.param into two separate loads like so: ``` ld.param.u32 %rd1, [foo_param_0+4]; shl.b64 %rd2, %rd1, 32; ld.param.u32 %rd3, [foo_param_0]; or.b64 %rd4, %rd2, %rd3; ``` It isn't necessary as far as I can tell from the PTX ISA documents to specify the alignment of params, nor to break the loading of params into smaller loads based on their alignment. So this patch changes the codegen to the better: ``` ld.param.u64 %rd1, [foo_param_0]; ```
2024-06-27[lldb] Parse and display register field enums (#95768)David Spickett8-22/+673
This teaches lldb to parse the enum XML elements sent by lldb-server, and make use of the information in `register read` and `register info`. The format is described in https://sourceware.org/gdb/current/onlinedocs/gdb.html/Enum-Target-Types.html. The target XML parser will drop any invalid enum or evalue. If we find multiple evalue for the same value, we will use the last one we find. The order of evalues from the XML is preserved as there may be good reason they are not in numerical order.
2024-06-27[X86][CodeGen] Support hoisting load/store with conditional faulting (#96720)Shengchen Kan12-15/+317
1. Add TTI interface for conditional load/store. 2. Mark 1 x i16/i32/i64 masked load/store legal so that it's not legalized in pass scalarize-masked-mem-intrin. 3. Visit 1 x i16/i32/i64 masked load/store to build a target-specific CLOAD/CSTORE node to avoid error in `DAGTypeLegalizer::ScalarizeVectorResult`. 4. Combine DAG to simplify the nodes for CLOAD/CSTORE. 5. Lower CLOAD/CSTORE to CFCMOV by pattern match. This is CodeGen part of #95515
2024-06-27[clang][Sema] Move the initializer lifetime checking code from SemaInit.cpp ↵Haojian Wu4-1230/+1291
to a new place, NFC (#96758) This is a refactoring change for better code isolation and reuse, the first step to extend it for assignments.
2024-06-27[lldb] Make use of Scripted{Python,}Interface for ScriptedThreadPlan ↵Med Ismail Bennani25-431/+471
(#70392) (#96868) This patch makes ScriptedThreadPlan conforming to the ScriptedInterface & ScriptedPythonInterface facilities by introducing 2 ScriptedThreadPlanInterface & ScriptedThreadPlanPythonInterface classes. This allows us to get rid of every ScriptedThreadPlan-specific SWIG method and re-use the same affordances as other scripting offordances, like Scripted{Process,Thread,Platform} & OperatingSystem. To do so, this adds new transformer methods for `ThreadPlan`, `Stream` & `Event`, to allow the bijection between C++ objects and their python counterparts. This just re-lands #70392 after fixing test failures. Signed-off-by: Med Ismail Bennani <ismail@bennani.ma>
2024-06-27[AMDGPU] Fix unwanted LICM/CSE of llvm.amdgcn.pops.exiting.wave.id (#96190)Jay Foad7-38/+31
Mark both the intrinsic and the selected MachineInstr as having side effects to prevent MachineLICM and MachineCSE from moving/removing them.
2024-06-27[lldb] Do not produce field information for registers known not to exist ↵David Spickett3-9/+12
(#95125) Currently the logic is generate field information for all registers in LinuxArm64RegisterFlags and then as we walk the existing register info, only those that are in that existing info will get the new fields patched in. This works fine but on a review for FreeBSD support it was pointed out that this is not obvious from the source code. So instead I've allowed the construction of empty lists of fields, and field detection methods can return an empty field list if they think that the register will never exist. Then the pre-existing code will see the empty field list, and never look for that register in the register info. I think removing the assert is ok because the GDB classes filter out empty field lists at runtime, and anyone updating the built in field information would presumably notice if none of the fields they intended to add were displayed. mte_ctrl and svcr are the only registers that need this so far. There is no extra testing here as the behaviour is the same, it doesn't add field information to regiters that don't exist. The mechanism is just clearer now.
2024-06-27DLTI: Simplifying getDevicePropertyValue API by returning Attribute type ↵Niranjan Hasabnis8-40/+79
value (#96706) **Rationale** - With the current flexibility of supporting any type of value, we will need to offer type-specific APIs to fetch a value (e.g., `getDevicePropertyValueAsInt` for integer type, `getDevicePropertyValueAsFloat` for float type, etc.) A single type of value will eliminate this need. - Current flexibility can also lead to typing errors when a user fetches the value of a property using an API that is not consistent with the type of the value. **What is the change** For following system description, ``` module attributes { dlti.target_system_spec = #dlti.target_system_spec< "CPU": #dlti.target_device_spec< #dlti.dl_entry<"max_vector_op_width", 64.0 : f32>>, "GPU": #dlti.target_device_spec< #dlti.dl_entry<"max_vector_op_width", 128 : ui32>> >} {} ``` a user no longer needs to use `getDevicePropertyValueAsInt` for retrieving GPU's `max_vector_op_width` and `getDevicePropertyValueAsFloat` for retrieving CPU's `max_vector_op_width`. Instead it can be done with a uniform API of `getDevicePropertyValue`.
2024-06-27[PatternMatch] Use m_Not instead of m_c_Xor with m_AllOnes() (#96837)AtariDreams3-21/+21
2024-06-27Revert "[PAC][AArch64] Lower ptrauth constants in code (#94241)" (#96865)Daniil Kovalev27-1223/+37
This reverts #94241. See buildbot failure https://lab.llvm.org/buildbot/#/builders/51/builds/570
2024-06-27[AArch64] Fix unused variable in release builds. NFC.Benjamin Kramer1-2/+1
2024-06-27[clang] Make header self-contained. NFC.Benjamin Kramer1-0/+1
2024-06-27Revert "[libc++] Use _If for conditional_t (#96193)"Benjamin Kramer1-4/+5
This reverts commit 2274c66e6faaaf29ad693b1ae3e5a7b0228a1950. It makes libc++ non-conforming, see discussion on the PR.
2024-06-27Revert "[mlir][Transforms] Dialect conversion: Simplify handling of dropped ↵Benjamin Kramer4-119/+156
arguments (#96207)" This reverts commit f1e0657d144f5a3cfef4b625d0f875f4dacd21d1. It breaks SCF conversion, see test case on the PR.
2024-06-27Revert "[mlir][Transforms][NFC] Dialect Conversion: Move argument ↵Benjamin Kramer1-52/+81
materialization logic (#96329)" This reverts commit c01ce797619359ee282773dfc4b1e91ff0a30435. It depends on f1e0657d144f5a3cfef4b625d0f875f4dacd21d1 which breaks SCF lowering.
2024-06-27[PAC][AArch64] Lower ptrauth constants in code (#94241)Daniil Kovalev27-37/+1224
Depends on #94240. Define the following pseudos for lowering ptrauth constants in code: - non-`extern_weak`: - no GOT load needed: `MOVaddrPAC` - similar to `MOVaddr`, with added PAC; - GOT load needed: `LOADgotPAC` - similar to `LOADgot`, with added PAC; - `extern_weak`: `LOADauthptrstatic` - similar to `LOADgot`, but use a special stub slot named `sym$auth_ptr$key$disc` filled by dynamic linker during relocation resolving instead of a GOT slot. --------- Co-authored-by: Ahmed Bougacha <ahmed@bougacha.org>
2024-06-27Revert "[CodeGen][NewPM] Port machine-branch-prob to new pass manager" (#96858)paperchalice24-154/+73
Reverts llvm/llvm-project#96389 Some ppc bots failed.
2024-06-27[mlir][linalg] Fix empty outer dim case for packing reshape op (#96732)yifeizh22-1/+41
This PR fixes the issue reported in [comment](https://github.com/llvm/llvm-project/pull/93529#discussion_r1653311765).
2024-06-27[clang][Interp] Fix CXXUuidOfExprs with incomplete record typesTimm Bäder2-2/+20
Create a dummy variable for those cases.
2024-06-27[ValueTypes][NFC] Generate EVT::getTypeForEVT from GenVT.inc (#96608)Kito Cheng2-361/+67
Most of MVT has simple mapping to the LLVM type, so it would be nice to auto generate that from ValueTypes.td, that could reduce the effort when we adding new MVT, especially new vector MVT with different size.
2024-06-27[Flang][OpenMP] Lowering Order clause to MLIR (#96730)harishch46-7/+111
2024-06-26[RISCV] Use StringRef instead of string_view in RISCVISAInfo. NFCCraig Topper1-1/+1
This is the only use of string_view in the file. Switch to StringRef for consistency.
2024-06-27[CodeGen][NewPM] Port machine-branch-prob to new pass manager (#96389)paperchalice24-73/+154
Like IR version `print<branch-prob>`, there is also a `print<machine-branch-prob>`.
2024-06-27gn: hwasan: fixup hwasan-preinit (#96748)Mitch Phillips2-1/+2
The build rule for hwasan_preinit outputs libclang_rt.hwasan_preinit, but clang expects hwasan-preinit (with a dash, rather than an underscore) when selecting the library in the frontend. Also, we were missing the hwasan-preinit dependency in check-hwasan. For posterity, this now passes hwasan unit tests on Android with: $ cat args.gn clang_base_path = "/usr/local" llvm_enable_assertions = true llvm_targets_to_build = "all" android_ndk_path = "/path/to/Android.sdk/ndk/25.2.9519653" $ /path/to/llvm/utils/gn/gn.py gen build $ ANDROID_SERIAL=xxx ninja -C build check-hwasan
2024-06-27[clang][transformer] Introduce a `constructExprArgs` range selector. (#95901)Clement Courbet3-13/+85
This is similar to `callArgs` but for construct exprs like `S(42)` or `{42}`.
2024-06-26Fix MSVC Demangling with auto NTTP mangled names for function pointer, ↵Max Winkler2-6/+89
pointer to data and integral types (#96590) As cited here, https://github.com/llvm/llvm-project/pull/92477, undname needs updating to support the new auto NTTP name mangling. In short the deduced type of the auto NTTP parameter is mangled as `$M <type> <nttp-param>`. However the deduced type is not printed for the undecorated name so the `$M <type>` is parsed but simply ignored when stringifying the generated AST.
2024-06-27Revert "[CodeGen] Introduce `MachineDomTreeUpdater`" (#96846)paperchalice11-981/+510
Reverts llvm/llvm-project#95369 Many build bots failed
2024-06-26[scudo] Minor refactoring of secondary cache test (#95995)ChiaHungDuan1-24/+25