506367 Commits

Author SHA1 Message Date
Phoebe Wang
d401987fe3 [X86][APX] Do not emit {evex} prefix for memory variant (#109759)
This was mistakely changed by #109579, which doesn't match with other
EVEX decoding.

(cherry picked from commit 70529b24a30943d46e361d2990268499921e28a2)
llvmorg-19.1.1
2024-10-01 14:08:12 +02:00
Phoebe Wang
edd018ead7 [X86][APX] Fix wrong encoding of promoted KMOV instructions due to missing NoCD8 (#109579)
Promoted KMOV* was encoded with CD8 incorrectly, see
https://godbolt.org/z/cax513hG1

(cherry picked from commit 0d334d83a4c7ce16fa1bc0e5e56bbdeaf01c2b2d)
2024-10-01 14:08:12 +02:00
Joe Faulls
1f681b5913 [CodeGen] Clear InitUndef pass new register cache between pass runs (#90967)
Multiple invocations of the pass could interfere with eachother,
preventing some undefs being initialised.

I found it very difficult to create a unit test for this due to it being
dependent on particular allocations of a previous function. However, the
bug can be observed here: https://godbolt.org/z/7xnMo41Gv with the
creation of the illegal instruction `vnsrl.wi v9, v8, 0`
2024-10-01 13:49:40 +02:00
David Spickett
23eadbda36 [libcxx][test] Use smaller time range for 32 bit time_t (#104762)
This fixes the test on Arm 32 bit Ubuntu Jammy where time_t is 32 bit.

(cherry picked from commit cdd608b8f0ce090b3568238387df368751bdbb5d)
2024-10-01 09:03:25 +02:00
David Spickett
4dbe72f91a [lldb][test] Mark sys_info zdump test unsupported on 32 bit Arm Linux
Until https://github.com/llvm/llvm-project/pull/103056 lands
or another more appropriate check can be found.

This test fails on Ubuntu Focal where zdump is built with 32 bit time_t
but passes on Ubuntu Jammy where zdump is built with 64 bit time_t.

Marking it unsupported means Linaro can upgrade its bots to Ubuntu
Jammy without getting an unexpected pass.

(cherry picked from commit 6f6422f4a2b8647a59936c131e50a79906d89510)
2024-10-01 09:03:25 +02:00
Tobias Hieta
fae11d419d
Bump version to 19.1.1 2024-10-01 09:02:07 +02:00
Petar Avramovic
962edd3f71 AMDGPU: Fix inst-selection of large scratch offsets with sgpr base (#110256)
Use i32 for offset instead of i16, this way it does not get interpreted
as negative 16 bit offset.

(cherry picked from commit 83fe85115da9dc25fa270d2ea8140113c8d49670)
2024-10-01 08:56:50 +02:00
Petar Avramovic
03d133728a AMDGPU: Add test for 16 bit unsigned scratch offsets (#110255)
Large scratch offset with one on highest bit selected as negative,
negative offset has same binary representation in 16 bits as large
unsigned offset.

(cherry picked from commit e9d12a6b451bd403d95105aa976a011dc821f126)
2024-10-01 08:56:50 +02:00
Louis Dionne
53010fcf66 [libc++] Fix AppleClang version number when checking for __builtin_verbose_trap support (#110161)
We should have been checking against 1700, not 17000, which was a typo.

(cherry picked from commit 1eba87904b0cbaaee82cfdb835528b85d99320ef)
2024-10-01 08:56:18 +02:00
Timothy Pearson
8679d1b51b [SDAG] Honor signed arguments in floating point libcalls (#109134)
In ExpandFPLibCall, an assumption is made that all floating point
libcalls that take integer arguments use unsigned integers. In the case
of ldexp and frexp, this assumption is incorrect, leading to
miscompilation and subsequent target-dependent incorrect operation.

Indicate that ldexp and frexp utilize signed arguments in
ExpandFPLibCall.

Fixes #108904

Signed-off-by: Timothy Pearson <tpearson@solidsilicon.com>
(cherry picked from commit 90c14748638f1e10e31173b145fdbb5c4529c922)
2024-10-01 08:55:02 +02:00
Weining Lu
b3734d9f93 [LoongArch] Fix the assertion for atomic store with 'ptr' type
(cherry picked from commit 63267ca9016aa334b329aa408716456b4e3799c8)
2024-10-01 08:53:44 +02:00
Martin Storsjö
997b66e566 [clang-scan-deps] Don't inspect Args[0] as an option (#109050)
Since a26ec542371652e1d774696e90016fd5b0b1c191, we expand the executable
name to an absolute path, if it isn't already one, if found in path.

This broke a couple tests in some environments; when the clang workdir
resides in a path under e.g. /opt. Tests that only use a tool name like
"clang-cl" would get expanded to the absolute path in the build tree.
The loop for finding the last "-o" like option for clang-cl command
lines would inspect all arguments, including Args[0] which is the
executable name itself. As an /opt path matches Arg.starts_with("/o"),
this would get detected as an object file output name in cases where
there was no other explicit output argument.

Thus, this fixes those tests in workdirs under e.g. /opt.

(cherry picked from commit cead9044a995910306e2e64b426fcc8042d7e0ef)
2024-10-01 08:53:03 +02:00
Martin Storsjö
2b6c23303f [clang-scan-deps] Infer the tool locations from PATH (#108539)
This allows the clang driver to know which tool is meant to be executed,
which allows the clang driver to load the right clang config files, and
allows clang to find colocated sysroots.

This makes sure that doing `clang-scan-deps -- <tool> ...` looks up
things in the same way as if one just would execute `<tool> ...`, when
`<tool>` isn't an absolute or relative path.

(cherry picked from commit a26ec542371652e1d774696e90016fd5b0b1c191)
2024-10-01 08:53:03 +02:00
Martin Storsjö
a0fc8a2b2b [clang-scan-deps] Fix builds with BUILD_SHARED_LIBS=ON
This fixes building in this configuration after
87e1104cf0e2de0d04bee2944893fa7897277b2f.

(cherry picked from commit aa3465793a250faa5426ac626989375465256658)
2024-10-01 08:53:03 +02:00
Martin Storsjö
7d1f2065d6 [clang-scan-deps] Infer the target from the executable name (#108189)
This allows clang-scan-deps to work correctly when using cross compilers
with names like <triple>-clang.

(cherry picked from commit 87e1104cf0e2de0d04bee2944893fa7897277b2f)
2024-10-01 08:53:03 +02:00
Nikita Popov
aaa7027716 [LoopPeel] Fix LCSSA phi node invalidation
In the test case, the BECount of the second loop uses %load,
but we only have an LCSSA phi node for %add, so that is what
gets invalidated. Use the forgetLcssaPhiWithNewPredecessor()
API instead, which will invalidate the roots of the expression
instead.

Fixes https://github.com/llvm/llvm-project/issues/109333.

(cherry picked from commit 5bcc82d43388bb0daa122d5fe7ecda5eca27fc16)
2024-10-01 08:52:08 +02:00
hev
99058521d4 [LoongArch] Eliminate the redundant sign extension of division (#107971)
If all incoming values of `div.d` are sign-extended and all users only
use the lower 32 bits, then convert them to W versions.

Fixes: #107946
(cherry picked from commit 0f47e3aebdd2a4a938468a272ea4224552dbf176)
2024-10-01 08:51:27 +02:00
Yingwei Zheng
a7554dfc22 [LoongArch][ISel] Check the number of sign bits in PatGprGpr_32 (#107432)
After https://github.com/llvm/llvm-project/pull/92205, LoongArch ISel
selects `div.w` for `trunc i64 (sdiv i64 3202030857, (sext i32 X to
i64)) to i32`. It is incorrect since `3202030857` is not a signed 32-bit
constant. It will produce wrong result when `X == 2`:
https://alive2.llvm.org/ce/z/pzfGZZ

This patch adds additional `sexti32` checks to operands of
`PatGprGpr_32`.
Alive2 proof: https://alive2.llvm.org/ce/z/AkH5Mp

Fix #107414.

(cherry picked from commit a111f9119a5ec77c19a514ec09454218f739454f)
2024-10-01 08:51:27 +02:00
Princeton Ferro
b3731b3642 [DAGCombiner] cache negative result from getMergeStoreCandidates() (#106949)
Cache negative search result from getStoreMergeCandidates() so that
mergeConsecutiveStores() does not iterate quadratically over a
potentially long sequence of unmergeable stores.

(cherry picked from commit 8f77d37f256809766fd83a09c6d144b785e9165a)
2024-10-01 08:47:51 +02:00
Yingwei Zheng
149bfdd61c [Clang][CodeGen] Fix type for atomic float incdec operators (#107075)
`llvm::ConstantFP::get(llvm::LLVMContext&, APFloat(float))` always
returns a f32 constant.
Fix https://github.com/llvm/llvm-project/issues/107054.
2024-10-01 08:47:00 +02:00
Louis Dionne
8a25c601eb [libc++] Disable the clang-tidy checks to get CI back (#109989)
The CI has been a complete mess for the past week, and the only thing
preventing it from being back is the Clang tidy checks. Disable them (as
a total hack) to get CI back.

(cherry picked from commit 78c6506543dee13c9335edc5c85bc73c4853fbd7)
2024-09-26 16:00:43 -04:00
Chuanqi Xu
4c51d827e5 [C++20] [Modules] Add Decl::isFromGlobalModule 2024-09-24 15:41:11 +08:00
Lang Hames
1c499a7200 [ORC] Remove EDU from dependants list of dependencies before destroying.
Dependant lists hold raw pointers back to EDUs that depend on them. We need to
remove these entries before destroying the EDU or we'll be left with a dangling
reference that can result in use-after-free bugs.

No testcase: This has only been observed in multi-threaded setups that
reproduce the issue inconsistently.

rdar://135403614
(cherry picked from commit 7034ec491251e598d2867199f89fefa3eb16a1a0)
2024-09-24 08:42:36 +02:00
Tom Stellard
c011dce7c2 workflows/release-binaries: Enable flang builds on Windows (#101344)
Flang for Windows depends on compiler-rt, so we need to enable it for
the stage1 builds. This also fixes failures building the flang tests on
macOS.

Fixes #100202.

(cherry picked from commit 8927576b8f6442bb6129bda597efee46176f8aec)
2024-09-24 08:39:15 +02:00
goldsteinn
5d41c20edb [Inliner] Fix bug where attributes are propagated incorrectly (#109347)
- **[Inliner] Add tests for incorrect propagation of return attrs; NFC**
- **[Inliner] Fix bug where attributes are propagated incorrectly**

The bug stems from the fact that we assume the new (inlined) callsite
is calling the same function as the original (callee) callsite. While
this is typically the case, since `VMap` simplifies the new
instructions, callee intrinsics callsites can end up not corresponding
with the same function.

This can lead to buggy propagation.

(cherry picked from commit a9352a0d31862c15146ca863bde165498e9a80e8)
2024-09-24 08:33:52 +02:00
Jonathan Tanner
38934af504 [AA] Take account of C++23's stricter rules for forward declarations (NFC) (#109416)
C++23 has stricter rules for forward declarations around
std::unique_ptr, this means that the inline declaration of the
constructor was failing under clang in C++23 mode, switching to an
out-of-line definition of the constructor fixes this.

This was fairly major impact as it blocked inclusion of a lot of headers
under clang in C++23 mode.

Fixes #106597.

(cherry picked from commit 76bc1eddb2cf8b6cc073649ade21b59bbed438a2)
2024-09-24 08:32:34 +02:00
Owen Pan
a4ace83470 [clang-format] Reimplement InsertNewlineAtEOF (#108513)
Fixes #108333.

(cherry picked from commit 7153a4bbf6d46e58ce32d59220515c5ab9f35691)
2024-09-24 08:31:46 +02:00
Chuanqi Xu
a8ddc3ce6b [C++20] [Modules] Treat in class defined member functions in language linkage as implicitly inline
Close https://github.com/llvm/llvm-project/issues/108732

This looks liek an oversight mostly.

(cherry picked from commit 7046a9fb05f65f4699a2e88abbcb7dad8a21db2d)
2024-09-24 08:29:59 +02:00
Chuanqi Xu
b881b16789 [C++20] [Modules] Treat constexpr/consteval member function as implicitly inline
Close https://github.com/llvm/llvm-project/issues/107673

(cherry picked from commit 74ac96ae1a81c7ecc0e27ff6f45309cff1f2df97)
2024-09-24 08:29:23 +02:00
Noah Goldstein
52a05d380f [X86] Fix missing check of rotate <-> shift equivilence (Issue 108722)
Previous code was checking that rotate and shift where equivilent when
transforming shift -> rotate but not the other way around.

Closes #108767

(cherry picked from commit 81279bf97f187eee0446af00d8ae9ec32a22e878)
2024-09-24 08:28:10 +02:00
Noah Goldstein
87c14bdb1a [X86] Add test for issue 108722; NFC
(cherry picked from commit 1c378d2b145578948942512f9d6985e37659d013)
2024-09-24 08:28:10 +02:00
wanglei
65b2007799 [LoongArch] Codegen for concat_vectors with LASX
Fixes: #107355

Reviewed By: SixWeining

Pull Request: https://github.com/llvm/llvm-project/pull/107523

(cherry picked from commit 1ca411ca451e0e86caf9207779616f32ed9fd908)
2024-09-24 08:27:11 +02:00
Michael Buch
ea3c81afdf
[lldb][test] TestDbgInfoContentVectorFromStdModule.py: skip test on Darwin (#108003)
This started failing on the macOS CI after
https://github.com/llvm/llvm-project/pull/106885:

```
  lldb-api :: commands/expression/import-std-module/vector-dbg-info-content/TestDbgInfoContentVectorFromStdModule.py

"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang"  -std=c++11 -g -O0 -isysroot "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" -arch arm64  -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info    -nostdlib++ -nostdinc++ -cxx-isystem /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include/c++/v1  --driver-mode=g++ -MT main.o -MD -MP -MF main.d -c -o main.o /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content/main.cpp
"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/bin/clang"  main.o -g -O0 -isysroot "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" -arch arm64  -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/tools/lldb/include -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/test/API/commands/expression/import-std-module/vector-dbg-info-content -I/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info     -L/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lib -Wl,-rpath,/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/lib -lc++ --driver-mode=g++ -o "a.out"
ld: warning: ignoring duplicate libraries: '-lc++'
codesign --entitlements /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/packages/Python/lldbsuite/test/make/entitlements-macos.plist -s - "a.out"
"/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/./bin/dsymutil"  -o "a.out.dSYM" "a.out"

runCmd: settings set target.import-std-module true

output:

runCmd: expr std::reverse(a.begin(), a.end())

Assertion failed: (isa<InjectedClassNameType>(Decl->TypeForDecl)), function getInjectedClassNameType, file ASTContext.cpp, line 5057.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	HandleCommand(command = "expr std::reverse(a.begin(), a.end())")
1.	<eof> parser at end of file
2.	/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include/c++/v1/__algorithm/reverse.h:54:1: instantiating function definition 'std::reverse<std::__wrap_iter<Foo *>>'
3.	/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include/c++/v1/__algorithm/reverse.h:47:58: instantiating function definition 'std::__reverse<std::_ClassicAlgPolicy, std::__wrap_iter<Foo *>, std::__wrap_iter<Foo *>>'
4.	/Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/lldb-build/include/c++/v1/__algorithm/reverse.h:40:1: instantiating function definition 'std::__reverse_impl<std::_ClassicAlgPolicy, std::__wrap_iter<Foo *>>'
```

(cherry picked from commit 2bcab9ba7139cfa96c85433fa85b29c8a6d7008b)
2024-09-24 08:25:04 +02:00
Tom Stellard
e1e7dfeb90
[lldb] Fix some tests that fail with system libstdc++ (#106885)
This is a revert of b1fcc1840c312472cb9ccb8c4e5e02ca13b31113.

These tests weren't working on Ubuntu 22.04 or Fedora 37-40. I'm not
sure exactly why, but it seems like they may be incompatible with
libstdc++. Also, despite the fact that the tests were using the system
libstdc++, the tests were only run when libcxx was enabled.

I tested this with a RelWithDebInfo build and the tests passed.

Fixes #106475

(cherry picked from commit adf44d5c3ea03569f019740e1140c3205810b3fa)
2024-09-24 08:24:50 +02:00
Patryk Wychowaniec
b8b5050279 [AVR] Fix 16-bit LDDs with immediate overflows (#104923)
16-bit loads are expanded into a pair of 8-bit loads, so the maximum
offset of such 16-bit loads must be 62, not 63.

(cherry picked from commit c7a4efa4294789b1116f0c4a320c16fcb27cb62c)
2024-09-24 08:23:17 +02:00
Younan Zhang
3e512ba17d [Clang][Concepts] Fix the constraint equivalence checking involving parameter packs (#102131)
We established an instantiation scope in order for constraint
equivalence checking to properly map the uninstantiated parameters.

That mechanism mapped even packs to themselves. Consequently, parameter
packs e.g. appearing in a function call, were not expanded. So they
would end up becoming `SubstTemplateTypeParmPackType`s that circularly
depend on the canonical declaration of the function template, which is
not yet determined, hence the spurious error.

No release note as I plan to backport it to 19.

Fixes https://github.com/llvm/llvm-project/issues/101735

---------

Co-authored-by: cor3ntin <corentinjabot@gmail.com>
(cherry picked from commit e6974daa7bc100c8b88057d50f3ec3eca7282243)
2024-09-24 08:22:28 +02:00
Fangrui Song
1720219a1d [ELF] --icf: don't fold a section without relocation and a section with relocations for SHT_CREL
Similar to commit 686cff17cc310884e48ae963bf7507f96950cc90 for SHT_REL (#57693).
CREL hasn't been tested with ICF before.

And avoid a pitfall that eqClass[0] might interfere with ICF.

(cherry picked from commit e82f0838ae88ad69515ebec234765e3e2607bebf)
2024-09-24 08:19:09 +02:00
hev
910dde5780 [LoongArch][sanitizer] Fix SC_ADDRERR_{RD,WR} missing in the musl environment (#108557)
Fixes #108550

(cherry picked from commit 1825cf28dc83113200b623ebcf063eea35ade79a)
2024-09-24 08:16:20 +02:00
Andrew Ng
22139b36d7 Reland [llvm-ml] Fix RIP-relative addressing for ptr operands (#108061)
Relands #107618 with fix for assertion triggered by OpenMP runtime MASM
assembly source.

(cherry picked from commit 7574e1ddc4be63628cb7617857cc8938058a79d2)
2024-09-24 08:15:17 +02:00
Tom Stellard
de7ee2e3ae [bolt][tests] Skip tests that use perf when perf counters are unavailable (#107892)
On the GitHub Action runners, perf always fails with the error below ,
so we need to skip the perf tests on platforms like this that have
limited access to the perf counters.

```
Access to performance monitoring and observability operations is limited.
Consider adjusting /proc/sys/kernel/perf_event_paranoid setting to open
access to performance monitoring and observability operations for processes
without CAP_PERFMON, CAP_SYS_PTRACE or CAP_SYS_ADMIN Linux capability.
More information can be found at 'Perf events and tool security' document:
https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html
perf_event_paranoid setting is 4:
  -1: Allow use of (almost) all events by all users
      Ignore mlock limit after perf_event_mlock_kb without CAP_IPC_LOCK
>= 0: Disallow raw and ftrace function tracepoint access
>= 1: Disallow CPU event access
>= 2: Disallow kernel profiling
To make the adjusted perf_event_paranoid setting permanent preserve it
in /etc/sysctl.conf (e.g. kernel.perf_event_paranoid = <setting>)
```

(cherry picked from commit 773353b20a49bfa0dab608d415c1b4734d037fce)
2024-09-24 08:13:07 +02:00
Martin Storsjö
64075837b5
[clang] Don't add DWARF debug info when assembling .s with clang-cl /Z7 (#106686)
This fixes a regression from f58330cbe44598eb2de0cca3b812f67fea0a71ca.

That commit changed the clang-cl options /Zi and /Z7 to be implemented
as aliases of -g rather than having separate handling.

This had the unintended effect, that when assembling .s files with
clang-cl, the /Z7 option (which implies using CodeView debug info) was
treated as a -g option, which causes `ClangAs::ConstructJob` to pick up
the option as part of `Args.getLastArg(options::OPT_g_Group)`, which
sets the `WantDebug` variable.

Within `Clang::ConstructJob`, we check for whether explicit `-gdwarf` or
`-gcodeview` options have been set, and if not, we pick the default
debug format for the current toolchain. However, in `ClangAs`, if debug
info has been enabled, it always adds DWARF debug info.

Add similar logic in `ClangAs` - check if the user has explicitly
requested either DWARF or CodeView, otherwise look up the toolchain
default. If we (either implicitly or explicitly) should be producing
CodeView, don't enable the default `ClangAs` DWARF generation.

This fixes the issue, where assembling a single `.s` file with clang-cl,
with the /Z7 option, causes the file to contain some DWARF sections.
This causes the output executable to contain DWARF, in addition to the
separate intended main PDB file.

By having the output executable contain DWARF sections, LLDB only looks
at the (very little) DWARF info in the executable, rather than looking
for a separate standalone PDB file. This caused an issue with LLDB's
tests, https://github.com/llvm/llvm-project/issues/101710.

(cherry picked from commit fcb7b390ccd5b4cfc71f13b5e16a846f3f400c10)
2024-09-18 16:01:50 +02:00
Tobias Hieta
a4bf6cd7cf
Bump version to 19.1.0 (final) llvmorg-19.1.0 2024-09-17 13:26:36 +02:00
Tobias Hieta
560ed047d1
Revert " [LoongArch][ISel] Check the number of sign bits in PatGprGpr_32 (#107432)"
This reverts commit 78654faa0c6d9dc2f72b81953b9cffbb7675755b.
2024-09-17 09:39:18 +02:00
Tobias Hieta
bd4ff65a60
Revert "[LoongArch] Eliminate the redundant sign extension of division (#107971)"
This reverts commit d752f29fb333d47724484e08b32d6499cc1e460e.
2024-09-17 09:39:01 +02:00
Zaara Syeda
bdae3c487c [PowerPC] Fix assert exposed by PR 95931 in LowerBITCAST (#108062)
Hit Assertion failed: Num < NumOperands && "Invalid child # of SDNode!"
Fix by checking opcode and value type before calling getOperand.

(cherry picked from commit 22067a8eb43a7194e65913b47a9c724fde3ed68f)
2024-09-16 20:33:55 +02:00
Ganesh Gopalasubramanian
149a150b50 [X86] AMD Zen 5 Initial enablement 2024-09-16 20:33:17 +02:00
Brian Cain
82e85b62da [lld] select a default eflags for hexagon (#108431)
Empty archives are apparently routine in linux kernel builds, so instead
of asserting, we should handle this case with a sane default value.

(cherry picked from commit d1ba432533aafc52fc59158350af937a8b6b9538)
2024-09-16 20:32:14 +02:00
Konstantin Varlamov
82f3a4a32d Guard an include of <ostream> in <chrono> with availability macro (#108429)
This fixes a regression introduced in
https://github.com/llvm/llvm-project/pull/96035.

(cherry picked from commit 127c34948bd54e92ef2ee544e8bc42acecf321ad)
2024-09-16 20:31:52 +02:00
Jonathon Penix
a847b66a75 [RISCV] Don't outline pcrel_lo when the function has a section prefix (#107943)
GNU ld will error when encountering a pcrel_lo whose corresponding
pcrel_hi is in a different section. [1] introduced a check to help
prevent this issue by preventing outlining in a few circumstances.
However, we can also hit this same issue when outlining from functions
with prefixes ("hot"/"unlikely"/"unknown" from profile information, for
example) as the outlined function might not have the same prefix,
possibly resulting in a "paired" pcrel_lo and pcrel_hi ending up in
different sections.

To prevent this issue, take a similar approach as [1] and additionally
prevent outlining when we see a pcrel_lo and the function has a prefix.

[1]
96c85f80f0

Fixes #107520

(cherry picked from commit 866b93e6b33fac9a4bc62bbc32199bd98f434784)
2024-09-16 20:31:06 +02:00
Nikolas Klauser
6278084bc6 [Clang] Fix crash due to invalid source location in __is_trivially_equality_comparable (#107815)
Fixes #107777

(cherry picked from commit 6dbdb8430b492959c399a7809247424c6962902f)
2024-09-16 20:30:33 +02:00