Commit Graph

541831 Commits

Author SHA1 Message Date
Vladimir Vuksanovic
a17b5bce8c [clang-reorder-fields] Prevent rewriting unsupported cases (#142149)
Add checks to prevent rewriting when doing so might result in incorrect
code. The following cases are checked:
- There are multiple field declarations in one statement like `int a, b`
- Multiple fields are created from a single macro expansion
- Preprocessor directives are present in the struct
2025-06-22 19:00:11 -07:00
Longsheng Mou
b00ddce731 [mlir][affine] Fix a crash when cast incompatible type (#145162)
This PR fixes a crash in `getSemiAffineExprFromFlatForm` when localExpr
is not `AffineBinaryOpExpr`. Fixes #144091.
2025-06-23 09:38:00 +08:00
Lang Hames
f9fce4975b [ORC] Fix potential stack corruption in Platform::lookupInitSymbols.
We can't exit early when on error here as some threads may still be holding
references to LookupMutex.

Since we don't need high performance in the error case the easy solution is to
drop the early-exit in the error case and wait for all tasks to complete before
returning the error.

Thanks to Jameson Nash for spotting this bug!
2025-06-23 09:51:50 +10:00
Kazu Hirata
9844085ea8 [lldb] Migrate away from ValueRange(std::nullopt) (NFC) (#145245)
ArrayRef has a constructor that accepts std::nullopt.  This
constructor dates back to the days when we still had llvm::Optional.

Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.

This patch takes care of the lldb side of migration.
2025-06-22 16:31:34 -07:00
Andrei Safronov
4154ada1d4 [Xtensa] Implement Xtensa Floating Point Option. (#136086)
Implement Xtensa FP Option instructions and lowering 
of the base FP operations with tests. Implement UR registers parsing.
 Fix loading from constant pool callee, basic block, globaladdress and
jumptable addresses. Also fixed potential memory leakage when several
similar XtensaConstantPoolValue objects are created Fix lowering i32 immediate.
2025-06-23 01:18:04 +03:00
Benji Smith
8f01edfa11 [C API] Add getter/setter for samesign flag on icmp (#145247)
This was added to the C++ API in
https://github.com/llvm/llvm-project/pull/111419 so this change adds
accessors in the C API, along with a couple tests.
2025-06-22 18:05:17 -04:00
Stanislav Mekhanoshin
40eee8ec7f [AMDGPU] Add s_setprio_inc_wg gfx1250 instruction (#145152) 2025-06-22 12:52:05 -07:00
Florian Hahn
f9c9a32e9c [LV] Add tests with fmax reductions without fast-math flags.
Adds extra tests with fmax reductions without fast-math flags for
upcoming patches.
2025-06-22 20:35:38 +01:00
Aiden Grossman
99cdc26c94 [CI] Cleanup buildkite test report script
This patch removes the generate_test_report_buildkite script entrypoint
as we no longer need it now that buildkite has been sunsetted. Also
remove the calls in the monolithic-* scripts given they are adding
complexity for no value.

Also remove the generate-buildkite-pipeline-premerge script as it is
no longer needed.

Reviewers: tstellar, DavidSpickett, lnihlen, cmtice

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/143480
2025-06-22 17:17:12 +00:00
Aiden Grossman
214ca3161b [CI] Test all projects when CI scripts change
This patch resolves a fixme in the compute_projects script to actually
test all the projects we can when touching something in the .ci
directory. This ensures we test things like compiler-rt before landing
changes.

Reviewers: gburgessiv, lnihlen, cmtice

Reviewed By: cmtice, gburgessiv

Pull Request: https://github.com/llvm/llvm-project/pull/144034
2025-06-22 17:12:16 +00:00
eleviant
80b9fcf8fd Revert "[lldb] Fix qEcho message handling (#145072)" (#145241)
Temporarily revert commit e066f35c69,
because lldb tests randomly hang after it's been pushed.
2025-06-22 18:59:08 +02:00
Aiden Grossman
ee414e3504 [CI] Refactor out some early exits in compute_projects
I have a habit of using early exits given it is in the LLVM coding
standards, but most of the early exits used within this script were
trivial and actually adding complexity. These are all instances where we
only perform one operation after the early exit, so removing the early
exit means less lines of code and arguably more readable code.

Reviewers: DavidSpickett, tstellar, cmtice, lnihlen

Reviewed By: DavidSpickett

Pull Request: https://github.com/llvm/llvm-project/pull/143478
2025-06-22 15:08:11 +00:00
Iris Shi
f2eb5d416e [SelectionDAG] Handle fneg/fabs/fcopysign in SimplifyDemandedBits (#139239) 2025-06-22 22:48:59 +08:00
David Green
078475d6c1 [ARM] Add test coverage for #144845 and regenerate tests. NFC 2025-06-22 15:24:39 +01:00
Matt Arsenault
584a2c2e7c AMDGPU: Avoid report_fatal_error for reporting libcalls (#145134) 2025-06-22 23:10:18 +09:00
Menooker
ee5dcdc275 [mlir] fix assertion failure in remove-dead-values (#144849)
Simple IR patterns will trigger assertion error:

```
  func.func @test_zero_operands(%I: memref<10xindex>, %I2: memref<10xf32>) {
    %v0 = arith.constant 0 : index
    %result = memref.alloca_scope -> index {
      %c = arith.addi %v0, %v0 : index
      memref.store %c, %I[%v0] : memref<10xindex>
      memref.alloca_scope.return %c: index
    }
    func.return
  }
```

with error: `mlir/include/mlir/IR/Operation.h:988:
mlir::detail::OperandStorage& mlir::Operation::getOperandStorage():
Assertion `hasOperandStorage && "expected operation to have operand
storage"' failed.`

This PR will fix this issue.

---------

Co-authored-by: Andrzej Warzyński <andrzej.warzynski@gmail.com>
Co-authored-by: Mehdi Amini <joker.eph@gmail.com>
2025-06-22 23:03:36 +09:00
Matt Arsenault
96493c514e AMDGPU: Use reportFatalUsageError for regalloc flag error (#145198) 2025-06-22 22:41:05 +09:00
Kazu Hirata
dec93ae454 [mlir] Migrate away from ValueRange(std::nullopt) (NFC) (#145210)
ArrayRef has a constructor that accepts std::nullopt.  This
constructor dates back to the days when we still had llvm::Optional.

Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.

One of the common uses of std::nullopt is in one of the constructors
for ValueRange.  This patch takes care of the migration where we need
ValueRange() to facilitate perfect forwarding.  Note that {} would be
ambiguous for perfecting forwarding to work.
2025-06-22 06:30:17 -07:00
Kazu Hirata
2ac293f5ac [lld] Use llvm::partition_point (NFC) (#145209) 2025-06-22 06:30:10 -07:00
Kazu Hirata
5d7d8d627a [Instrumentation] Drop "const" from a return type (NFC) (#145208)
We don't need to put a const on a return type.
2025-06-22 06:30:02 -07:00
Florian Hahn
0dc0aeb14f [LV] Add additional tests for replicating calls returning structs.
Add additional test coverage for replicating calls return structs, in
particular cases where the number of struct elements does not match the
VF.

Extra test coverage for
https://github.com/llvm/llvm-project/pull/142433.
2025-06-22 13:48:25 +01:00
Simon Pilgrim
26390f22b8 [VectorCombine] foldShuffleOfShuffles - fold shuffle(shuffle(x,y),poison) length changing masks (#144690)
The shuffle merging code assumes that the shuffle sources are all the
same type, which fails if we've changed length and don't have 2 inner
shuffles. We already handle length-changing shuffles if we do have 2
inner shuffles.

This patch creates a fake "all poison" shuffle mask and reuses the other
shuffle's sources, which can be safely used with the existing merge
code.

The alternative was a considerable refactor of the merge code to account
for different vector widths......

Fixes #144656
2025-06-22 13:30:45 +01:00
Michael Buch
d2c0451d05 [lldb][DWAFASTParserClang][NFC] Rename GetCXXObjectParameter to GetObjectParameter
Since this is used for Objective-C too.
2025-06-22 11:41:48 +01:00
Patryk Wychowaniec
c7d9eabf4a [AVR] Don't apply post-indexing on mismatched pointers (#145224)
fixes https://github.com/llvm/llvm-project/issues/143247
2025-06-22 18:18:00 +08:00
Jim Lin
f78819aeef Revert "Revert "[RISCV] Remove B and Zbc extension from Andes series cpus." (#144402)"
Since the fix https://github.com/llvm/llvm-project/pull/144848 for post-commit CI failure
has landed.

This reverts commit f83d09a1f6.
2025-06-22 17:54:37 +08:00
David Green
8583882bdc [AArch64] Remove unnecessary DL variable. NFC 2025-06-22 10:52:13 +01:00
Mehdi Amini
075cb691a5 [MLIR] Add logging/tracing to DataFlow analysis and RemoveDeadValues (NFC) (#144695)
Debugging issues with this pass is quite difficult at the moment, this
should help.
2025-06-22 11:40:01 +02:00
Evan Liu
6ae5b89553 Make getStridesAndOffset const (#145148)
Make getStridesAndOffset const.
2025-06-22 11:21:47 +02:00
Florian Hahn
58b939abe5 [VPlan] Support matching constants in narrowInterleaveGroups.
Matching constants can trivially be broadcasted, allow them if the same
constant is used for all recipes in a bundle.
2025-06-22 08:45:40 +01:00
Abhishek Kaushik
cbfec48697 Revert "[X86][NFC] Use std::move to avoid copy" (#145215)
Reverts llvm/llvm-project#141455
2025-06-22 12:52:57 +05:30
Iris Shi
f51d8730b3 [InstSimplify] Simplify 'x u>= 1' to true when x is known non-zero (#145204) 2025-06-22 13:32:19 +08:00
Stanislav Mekhanoshin
fa0b84f23c [AMDGPU] Rename call instructions from b64 to i64 (#145103)
These get renamed in gfx1250 and on from B64 to I64:

  S_CALL_I64
  S_GET_PC_I64
  S_RFE_I64
  S_SET_PC_I64
  S_SWAP_PC_I64
2025-06-21 21:42:09 -07:00
Craig Topper
b7d0c9b9d8 [SelectionDAG][RISCV] Treat zext nneg as sext in PromoteIntOp_ZERO_EXTEND if the promoted input is sign extended. (#145120)
If the zext has the nneg flag and we can prove the promoted input
is sign extended, we can avoid generating an AND that we might not
be able to remove. RISC-V emits a lot of sext_inreg operations during
i32->i64 promotion that makes this likely.

I've restricted this to the case where the promoted type is the same
as the result type so we don't need to create an additional extend.

I've also restricted it to cases where the target has stated a
preference for sext like i32->i64 on RV64. This is largely to avoid
wasting time in computeNumSignBits until we have a test case that
benefits.
2025-06-21 18:56:00 -07:00
Matt Arsenault
f280d3b705 AMDGPU: Avoid report_fatal_error for getRegisterByName subtarget case (#145173) 2025-06-22 08:19:19 +09:00
Arthur Eubanks
5708851283 Revert "[ValueTracking] Improve Bitcast handling to match SDAG" (#145191)
Reverts llvm/llvm-project#125935

Causes miscompiles, see comments in #125935
2025-06-21 16:02:26 -07:00
Douglas Yung
757c80d88a Add REQUIRES: x86 to test added in 141197 to skip when x86 target is not present. 2025-06-21 22:37:02 +00:00
Florian Hahn
c455f4a32d [LV] Add more tests for narrowing interleave groups with live-ins. 2025-06-21 22:03:19 +01:00
eleviant
e066f35c69 [lldb] Fix qEcho message handling (#145072)
Patch fixes the sync-on-timeout logic in lldb and switches to qEcho
based ping, instead of qC. This fixes vRun message case, when there is
no process yet and qC returns an error.
2025-06-21 22:48:08 +02:00
Erick Velez
056b52df34 [clang-doc] Precommit test for global variables (#145069) 2025-06-21 11:56:35 -07:00
LLVM GN Syncbot
550ed9ef19 [gn build] Port e7dd223ec4 2025-06-21 18:10:42 +00:00
Katherine Whitlock
e7dd223ec4 [clang-tidy] Add new check readability-use-numeric-limits (#127430)
The adds a check that replaces specific numeric literals like `32767`
with the equivalent call to `std::numeric_limits` (such as
`std::numeric_limits<int16_t>::max())`.

Partially addresses #34434, but notably does not handle cases listed in
the title post such as `~0` and `-1`.
2025-06-21 21:10:20 +03:00
Tal Kedar
2ed089fb18 [clang/docs] add a missing brace in ClangFormatStyleOptions.rst (#145145)
... in the example for `WrapNamespaceBodyWithEmptyLines: Never`
2025-06-21 20:00:22 +02:00
Mikhail R. Gadelha
6c8c816b17 [libc] Fix feature check for riscv (#145169)
This PR fixes the feature detection for RISC-V floating-point support in
LLVM's libc implementation.

The `__riscv_flen` macro represents the floating-point register width in
bits (32, 64, or 128). Since Extension D is specifically documented as
implying F, we can use simple >= comparisons to detect them.

For half-precision support, the implementation checks for the Zfhmin
extension as RVA22 and RVA23 profiles only require Zfhmin rather than
the full Zfh extension. Zfh also implies Zfhmin, so checking for Zfhmin
should cover all cases.
2025-06-21 14:42:45 -03:00
Craig Topper
0c47628515 Re-commit "[RISCV] Properly support RISCVISD::LLA in getTargetConstantFromLoad. (#145112)"
With proper co-author.

Original message:

We need to pass the operand of LLA to GetSupportedConstantPool.

This replaces #142292 with test from there added as a pre-commit
for both medlow and pic.

Co-authored-by: Carl Nettelblad carl.nettelblad@rapidity-space.com
2025-06-21 10:18:49 -07:00
Craig Topper
fc36e47a49 Revert "[RISCV] Properly support RISCVISD::LLA in getTargetConstantFromLoad. (#145112)"
I missed the Co-authored-by that I tried to add.

This reverts commit 1da864b574.
2025-06-21 10:18:34 -07:00
Craig Topper
1da864b574 [RISCV] Properly support RISCVISD::LLA in getTargetConstantFromLoad. (#145112)
We need to pass the operand of LLA to GetSupportedConstantPool.
    
This replaces #142292 with test from there added as a pre-commit
for both medlow and pic.
2025-06-21 10:17:30 -07:00
Florian Hahn
9f7a155394 [VPlan] Update packScalarIntoVector to take and return wide value (NFC)
Make the function more flexible in preparation for new users.
2025-06-21 18:03:14 +01:00
Abhishek Kaushik
4c1a1009ad [X86][NFC] Use std::move to avoid copy (#141455) 2025-06-21 22:04:41 +05:30
Kazu Hirata
463ce01310 [CodeGen] Remove extraneous casts to VariableID (NFC) (#145144)
We do not need these casts because values being cast here are already
of type VariableID.
2025-06-21 08:21:04 -07:00
Kazu Hirata
ae372bfca8 [CodeGen] Use range-based for loops (NFC) (#145142) 2025-06-21 08:20:57 -07:00