Commit Graph

522583 Commits

Author SHA1 Message Date
Roland McGrath
62cd050b63 [libc] Move hdrgen yaml files into include/ (#121443)
The .yaml files should live next to the corresponding .h.def
files in libc/include/, rather than next to the implementation of
the tool in libc/utils/hdrgen/.  As with the .h.def files, there
is no need for a yaml/ subdirectory under include/.  This simpler
layout is more natural for maintenance and also simplifies build
integration outside the LLVM CMake build.
2025-01-01 17:03:35 -08:00
Owen Pan
cd239493c1 [clang-format] Support globstar in .clang-format-ignore (#121404)
Closes #110160.
Closes #114969.
2025-01-01 15:37:59 -08:00
Florian Hahn
c7ebe4fd0a [VPlan] Replace VPBBs with VPIRBBs during skeleton creation (NFC).
Move replacement of VPBBs for vector preheader, middle block and scalar
preheader from VPlan::execute to skeleton creation, which actually
creates the IR basic blocks.

For now, the vector preheader can only be replaced after
prepareToExecute as it may create new instructions in the vector
preheader.
2025-01-01 22:05:43 +00:00
Florian Hahn
418dedc234 [VPlan] Remove redundant setting of insert point in ::executePlan (NFC).
The entry block is a VPIRBasicBkock wrapping the original loop's
preheader, so the insert point doesn't need to be set.
2025-01-01 21:44:22 +00:00
Peng Huang
bd154e823e Reapply "[Driver][OHOS] Fix lld link issue for OHOS (#118192)" (#120159)
The problem in original change is because OHOS::getCompilerRT()
pickes a wrong builtin runtime
`./lib/clang/20/lib/linux/libclang_rt.builtins-x86_64.a`,
if `./lib/clang/20/lib/linux/libclang_rt.builtins-x86_64.a` exist on the
test filesystem. It shouldn't happen with a clean build.
2025-01-01 13:19:39 -08:00
Nico Weber
0cbe28df71 [gn] port 28ae2ff2a4 2025-01-01 14:24:25 -05:00
Philip Reames
6840521739 Revert "[RISCV][CG]Use processShuffleMasks for per-register shuffles"
This reverts commit b8952d4b1b.

spec x264 fails to build in all VLS configurations, with the assertion
failure: clang: ../llvm-project/llvm/lib/Target/RISCV/RISCVISelLowering.cpp:5246: llvm::SDValue lowerShuffleViaVRegSplitting(llvm::ShuffleVectorSDNode*, llvm::SelectionDAG&, const llvm::RISCVSubtarget&): Assertion `RegCnt == NumOfDestRegs && "Whole vector must be processed"' failed.

I can reduce a failing piece of IR, but the failure appears pretty
broad, so I suspect any reasonable vls build will hit it.
2025-01-01 10:53:24 -08:00
Jacek Caban
8435225374 [LLD][COFF] Move addFile implementation to LinkerDriver (NFC) (#121342)
The addFile implementation does not rely on the SymbolTable object. With
#119294, the symbol table for input files is determined during the
construction of the objects representing them. To clarify that
relationship, this change moves the implementation from the SymbolTable
class to the LinkerDriver class.
2025-01-01 19:42:49 +01:00
Mark Danial
1135d36f86 [AIX] [lit] Fix shtest-format.py to account for behaviour on AIX (#121426)
The changes from https://github.com/llvm/llvm-project/pull/121376 has
broken the ppc64 aix bot:
https://lab.llvm.org/buildbot/#/builders/64/builds/1835. Adjusted the
testcase to account for `cat` behaviour on AIX prior to the changes
2025-01-01 13:34:28 -05:00
Stephen Senran Zhang
2a90efd854 [NFC][ConstraintElimination] Optimize code styles (#121422)
This patch does following things,

- prefer early exits;
- add missing std::move;
- avoid duplicate map lookups;
- prefer emplace_back to avoid unnecessary copies.
2025-01-01 09:53:31 -08:00
Tomer Shafir
6d3d952f11 [XRay][account] add account test for nonempty exit mismatch (#93564)
- Add `llvm-xray account` regression test for an exit mismatch with a
non empty stack (its a different code path than empty stack).
- Align empty stack test case name.
2025-01-01 09:52:38 -08:00
Michał Górny
fac6be61c6 [mlir] Prepend include directories before LLVM includes (#121223)
Prepend mlir's include directories before system LLVM include
directories. This is particularly important for standalone builds, where
system include directory may contain the previous version of mlir, and
therefore various mlir targets (particularly tablegen) end up using the
headers from the previous version over the fresh ones. The new logic is
copied from clang.
2025-01-01 15:31:49 +00:00
Vitaly Buka
ed572f2003 Reapply "[libc++] Explicitly convert to masks in SIMD code (#107983)" (#121352)
This reverts commit 0ea40bf021.

Passes with https://github.com/llvm/llvm-project/issues/121365 fix: 
https://lab.llvm.org/buildbot/#/builders/55/builds/4930
2025-01-01 11:30:35 +01:00
Akshat Oke
50054ba2f4 [CodeGen] LiveRegMatrix: Use allocator through a unique_ptr (#120556)
`LIU::Matrix` holds on to a pointer to the allocator in LiveRegMatrix and is left hanging when the allocator moves with the LiveRegMatrix.

This extends the lifetime of the allocator so that it does not get destroyed when moving a LiveRegMatrix object.
2025-01-01 14:54:08 +05:30
xtex
ca2ab74838 [clang] Canonicalize absolute paths in dependency file (#117458)
This fixes #117438.

If paths in dependency file are not absoulte, make (or ninja) will
canonicalize them.
While their canonicalization does not involves symbolic links expansion
(for IO performance concerns), leaving a non-absolute path in dependency
file may lead to unexpected canonicalization.
For example, '/a/../b', where '/a' is a symlink to '/c/d', it should be
'/c/b' but make (and ninja) canonicalizes it as '/b', and fails for file
not found.
2025-01-01 00:29:04 -08:00
TilakChad
1623c43594 [Clang] Resolved type of expression indexing into pack of values of a non-dependent type (#121405) 2025-01-01 15:50:05 +08:00
Akshat Oke
a29bd8cbab [CodeGen][NewPM] Record parameterized machine pass names to PIC (#120554)
Required for `{start|stop}-{after-before}` cli
2025-01-01 12:36:10 +05:30
Yingwei Zheng
eafbab6fac [EntryExitInstrumenter][AArch64][RISCV][LoongArch] Pass __builtin_return_address(0) into _mcount (#121107)
On RISC-V, AArch64, and LoongArch, the `_mcount` function takes
`__builtin_return_address(0)` as an argument since
`__builtin_return_address(1)` is not available on these platforms. This
patch fixes the argument passing to match the behavior of glibc/gcc.

Closes https://github.com/llvm/llvm-project/issues/121103.
2025-01-01 15:02:08 +08:00
Vikash Gupta
283806695a [GlobalIsel] Add combine for select with constants (#121088)
The SelectionDAG Isel supports the both version of combines mentioned
below :
```
select Cond, Pow2, 0 --> (zext Cond)  << log2(Pow2) 
select Cond, 0, Pow2 --> (zext !Cond) << log2(Pow2)
```
The GlobalIsel for now only supports the first one defined in it's
generic combinerHelper.cpp. This patch adds the missing second one.
2025-01-01 11:14:53 +05:30
Vikram Hegde
f1fa292cd6 [AMDGPU] Pre-commit tests for "lshr + mad" fold (#119509) 2025-01-01 10:17:37 +05:30
Stephen Senran Zhang
2feffecb88 [ConstantRange] Estimate tighter lower (upper) bounds for masked binary and (or) (#120352)
Fixes #118108.

Co-author: Yingwei Zheng (@dtcxzyw)
2024-12-31 18:40:17 -08:00
Tristan Ross
1d0f40ba05 [libc] fix generic __stack_check_fail for fuchsia (#121401) 2024-12-31 19:36:24 -05:00
Florian Hahn
3026ecaff5 [LV] Also verify loops in vector loop removal tests.
Also verify loop info in tests added in 7d6ec3b968.
2024-12-31 20:11:23 +00:00
Florian Hahn
7d6ec3b968 [LV] Add more tests for vector loop removal.
Add missing test coverage of loops where the vector loop region can be
removed that include replicate recipes as well as nested loops.

Extra test coverage for https://github.com/llvm/llvm-project/pull/108378.
2024-12-31 20:08:54 +00:00
Florian Hahn
b06a45c66f [VPlan] Add all blocks to outer loop if present during ::execute (NFCI).
This ensures that all blocks created during VPlan execution are properly
added to an enclosing loop, if present.

Split off from https://github.com/llvm/llvm-project/pull/108378 and also
needed once more of the skeleton blocks are created directly via VPlan.

This also allows removing the custom logic for early-exit loop
vectorization added as part of
https://github.com/llvm/llvm-project/pull/117008.
2024-12-31 19:34:34 +00:00
David Green
71d6b0b0c1 [AArch64][GlobalISel] Lower shuffle vector with scalar destinations. (#121384)
I believe these are usually canonicalized to vector extracts in most
situations, but under -O0 we might trigger failures in the widening code
if we do not handle scalar destinations correctly. The simplest solution
should be to lower the shuffle to an extract.

Fixes #121365.
2024-12-31 19:08:05 +00:00
Jason Molenda
5056a4b556 [lldb] Update two API tests to fix x86 Darwin failures (#121380)
The Intel Darwin CI bots had their Xcode updated, which brought in a
debugserver with Brendan Shanks' change from September
7281e0cb3b
https://github.com/llvm/llvm-project/pull/108663 where four general
purpose registers are sent by debugserver when in certain process
states. But most processes (nearly all in the testsuite) do not have
these registers available, so we will get register read failures when
requesting those four. These two tests would flag those as errors. There
would have been an additional problem with the g/G packet (which lldb
doesn't use w/ debugserver, but the testsuite tests) if placeholder
values were not included in the full register context bytes; I fixed
that issue with the SME patch to debugserver recently already.
2024-12-31 10:48:26 -08:00
David Green
2cee9034ad [AArch64] Add some tests for csel/subs with swapped conditions. NFC 2024-12-31 18:07:10 +00:00
Ivan Butygin
0e23cb0cc5 [mlir][nfc] GpuToROCDL: Remove some dead code (#121403) 2024-12-31 20:39:31 +03:00
Spencer Abson
a5f3058caa [AArch64][NFC] Remove redundant comments in SMEInstrInfo 2024-12-31 17:32:44 +00:00
B I Mohammed Abbas
8e8d0c1499 Fix integer suffix in truncxfhf2_test (#121388)
Fixes error introduced by #120372.
2024-12-31 09:27:15 -08:00
Ellis Hoag
40e734e041 [lld][MachO] Allow separate --irpgo-profile flag (#121354) 2024-12-31 09:07:00 -08:00
Angus Lees
ebdb6cf2ac [lit] Cope with more cat variants (#121376)
BusyBox `cat` has yet another slight variation of error formatting:

```console
$ cat --help 2>&1 | head -1
BusyBox v1.37.0 (2024-09-30 10:39:57 UTC) multi-call binary.

$ cat does-not-exist
cat: can't open 'does-not-exist': No such file or directory
```

Rather than extend the test result regex with a third case,
recognise that we only really care about the filename and errno string.
Weaken the regex to ignore all "noise" around the filename.

Note this also corrects what looks like a bug with the previous regex.
Previously, the `cannot open does-not-exist` alternate did not assert
the following errno message.  This was introduced in
https://reviews.llvm.org/D60553 (apparently) due to differences in the
`cat` command on AIX.  That bug doesn't include the specific
AIX output, so it's unclear if this omission was intended.
2024-12-31 16:52:35 +00:00
Ivan Butygin
018b32ca1f Revert "[mlir][nfc] GpuToROCDL: Remove some dead code" (#121402)
Reverts llvm/llvm-project#121395
2024-12-31 18:55:00 +03:00
Ivan Butygin
0b08e095cc [mlir][nfc] GpuToROCDL: Remove some dead code (#121395) 2024-12-31 18:54:41 +03:00
Simon Pilgrim
d1e5e6735a [PhaseOrdering] Update test RUN lines to use -passes="default<O3>" to allow evaluation by DOS batch scripts. NFC.
`-passes='default<O3>'` isn't correctly parsed on DOS, so when update_test_checks.py runs a system call on the opt RUN line, it fails to evaluate properly - use `-passes="default<O3>"` instead.
2024-12-31 15:25:12 +00:00
Simon Pilgrim
b195bb87e1 [VectorCombine] scalarizeLoadExtract - consistently use LoadInst and ExtractElementInst specific operand getters. NFC
Noticed while investigating the hung builds reported after af83093933
2024-12-31 14:42:39 +00:00
Simon Pilgrim
6279d2e0f3 AArch64ABIInfo::passAsAggregateType - don't directly dereference getAs<> result. NFC.
Reported by coverity static analyzer - we know the type is a BuiltinType so use castAs<>
2024-12-31 14:34:14 +00:00
Florian Hahn
ddef380cd6 [VPlan] Move simplifyRecipe(s) definitions up to allow re-use (NFC)
Move definitions to allow easy reuse in
https://github.com/llvm/llvm-project/pull/108378.
2024-12-31 13:23:19 +00:00
Zibi Sarbinowski
1d51546635 [SystemZ][z/OS] Open YAML files for read as text files (#121340)
This patch makes sure YAML files are opened for reading as text file to
trigger auto-conversion from EBCDIC encoding into expected ASCII
encoding on z/OS platform. This is required to fix the following lit
tests:

```
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-exe.yaml
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-obj.test
LLVM :: tools/llvm-gsymutil/ARM_AArch64/macho-gsym-callsite-info-dsym.yaml
LLVM :: Transforms/PGOProfile/memprof_undrift_missing_leaf.ll
```
2024-12-31 07:24:59 -05:00
Matthias Springer
80ecbaa3c0 [mlir][Transforms] Mark 1:N conversion driver as deprecated (#121102)
The 1:N conversion driver will be removed soon.

Note for LLVM integration: Please migrate your code base to the regular dialect conversion driver.
2024-12-31 13:11:19 +01:00
Matthias Springer
31613de9cf [mlir][ArmSME] Migrate arm-sme-vector-legalization to dialect conversion (#121101)
Use the regular dialect conversion driver instead of the 1:N dialect
conversion driver. The 1:N dialect conversion driver will be removed
soon.
2024-12-31 12:44:50 +01:00
Timm Baeder
f0d60170cc [clang][bytecode] Check memove/memcpy for available elements (#121383)
Both destination and source pointer need to have at least as many
elements as requested.
2024-12-31 12:14:27 +01:00
David Green
b35d3453dd [AArch64] Add an option for sve-prefer-fixed-over-scalable-if-equal. NFC
Add a new option to control preferFixedOverScalableIfEqualCost, useful for
testing.
2024-12-31 11:07:42 +00:00
Julian Nagele
f035351af7 [SCEV] Make sure starting block is marked as visited when recursively collecting loop guards. (#120749)
When `collectFromBlock` is called without a predecessor (in particular
for loops that don't have a unique predecessor outside the loop) we
never start climbing the predecessor chain, and thus don't mark the
starting block as visited.

Fixes https://github.com/llvm/llvm-project/issues/120615.
2024-12-31 09:24:48 +00:00
Wang Pengcheng
e3fe41cdf5 [RISCV] Add missing ReadFMA16Addend in UnsupportedSchedZfh 2024-12-31 17:22:08 +08:00
Wang Pengcheng
5b5ef254a3 [RISCV] Fix typo: vmv.x.i -> vmv.v.i 2024-12-31 16:18:13 +08:00
Tristan Ross
6f3d1d3018 [libc] add __stack_chk_guard to generic (#121121) 2024-12-31 02:34:16 -05:00
Karthika Devi C
2e3d3903e6 [polly] Skip instructions of different function in isHoistableLoad. (#118963)
After patch 5ce47a5, some assert crashes occur in Polly. This issue
arises because an instruction from one function queries the Dominator
Tree (DT) of another function. To fix this, the `isHoistableLoad`
function now skips instructions that belong to different function while
iterating.
2024-12-31 11:57:34 +05:30
Philipp van Kempen
f590963db8 [RISCV] Implement RISCVTTIImpl::getPreferredAddressingMode for HasVendorXCVmem (#120533)
For a simple matmult kernel this heuristic reduces the length of the
critical basic block from 15 to 20 instructions, resulting in a 20%
speedup.

**Without heuristic:**

```
       13688: 001b838b      cv.lb   t2, (s7), 0x1
       1368c: 09cdbcab      cv.lb   s9, t3(s11)
       13690: 089db62b      cv.lb   a2, s1(s11)
       13694: 092dbdab      cv.lb   s11, s2(s11)
       13698: 001d028b      cv.lb   t0, (s10), 0x1
       1369c: 00f282b3      add     t0, t0, a5
       136a0: 9072b52b      cv.mac  a0, t0, t2
       136a4: 9192bfab      cv.mac  t6, t0, s9
       136a8: 90c2beab      cv.mac  t4, t0, a2
       136ac: 91b2bf2b      cv.mac  t5, t0, s11
       136b0: fffc0c13      addi    s8, s8, -0x1
       136b4: 018e0633      add     a2, t3, s8
       136b8: 91b2b0ab      cv.mac  ra, t0, s11
       136bc: 000b8d93      mv      s11, s7
       136c0: fc0614e3      bnez    a2, 0x13688 <muriscv_nn_vec_mat_mult_t_s8+0x2f0>

       #instrs = 15
```

**With heuristic:**

```
        7bc0: 001c860b      cv.lb   a2, (s9), 0x1
        7bc4: 001e0d0b      cv.lb   s10, (t3), 0x1
        7bc8: 001e808b      cv.lb   ra, (t4), 0x1
        7bcc: 0015038b      cv.lb   t2, (a0), 0x1
        7bd0: 001c028b      cv.lb   t0, (s8), 0x1
        7bd4: 00f282b3      add     t0, t0, a5
        7bd8: 90c2bfab      cv.mac  t6, t0, a2
        7bdc: 91a2b92b      cv.mac  s2, t0, s10
        7be0: 9012b5ab      cv.mac  a1, t0, ra
        7be4: 9072b9ab      cv.mac  s3, t0, t2
        7be8: 9072b72b      cv.mac  a4, t0, t2
        7bec: fc851ae3      bne     a0, s0, 0x7bc0 <muriscv_nn_vec_mat_mult_t_s8+0x338>

        #instrs = 12

        improvement = 1 - 12/15 = 0.2 = 20%
```
2024-12-31 10:56:28 +08:00