512336 Commits

Author SHA1 Message Date
Helena Kotas
f2128267c2
[HLSL][NFC] Remove RegisterBindingFlags struct (#108924)
When diagnosing register bindings we just need to make sure there is a
resource that matches the provided register type. We can emit the
diagnostics right away instead of collecting flags in the
RegisterBindingFlags struct. That also enables early exit when scanning
user defined types because we can return as soon as we find a matching
resource for the given register type.
2024-09-18 10:51:30 -07:00
Jacek Caban
86d2abefcb
[LLD][COFF] Store __imp_ symbols as Defined in InputFile (#109115) 2024-09-18 19:49:06 +02:00
Fangrui Song
e06f32114d [CSKY,M68k,Xtensa] Update function names after #108643 2024-09-18 10:48:45 -07:00
Rahul Joshi
2c966709b7
[LLVM][TableGen] Change CompressInstEmitter to use const RecordKeeper (#109035)
Change CompressInstEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 10:42:51 -07:00
Rahul Joshi
80aa4dab1e
[LLVM][TableGen] Change X86FoldTablesEmitter to use const RecordKeeper (#109070)
Change X86FoldTablesEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 10:41:57 -07:00
Rahul Joshi
1a793a8ca0
[LLVM][TableGen] Change X86InstrMapping to use const RecordKeeper (#109066)
Change X86InstrMappingEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 10:41:21 -07:00
Joseph Huber
5f02558d82
[OpenMP] Fix not linking C libraries when enabled (#109168)
Summary:
We used to do this automatically, add it back in to do it manually.
2024-09-18 10:02:16 -07:00
Rahul Joshi
b18190ebfc
[LLVM][TableGen] Change MacroFusionPredicator to use const RecordKeeper (#109064)
Change MacroFusionPredicator to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:59:24 -07:00
Rahul Joshi
47d76a9910
[LLVM][TableGen] Change InstrDocsEmitter to use const RecordKeeper (#109061)
Change InstrDocsEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:58:36 -07:00
Rahul Joshi
ab2b333f0d
[LLVM][TableGen] Change FastISelEmitter to use const RecordKeeper (#109060)
Change FastISelEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:58:04 -07:00
Rahul Joshi
74335fb7ae
[LLVM][TableGen] Change X86MnemonicTables to use const RecordKeeper (#109053)
Change X86MnemonicTables to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:57:31 -07:00
Rahul Joshi
4fbac52841
[LLVM][TableGen] Change DXILEmitter to use const RecordKeeper (#109045)
Change DXILEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:56:56 -07:00
Craig Topper
06048aaa73
[Target] Use 'unsigned' as the underlying type for the tablegened physical register enums. (#109086)
Otherwise, the enum defaults to 'int'. Update a few places that used
'int' for registers that now need to change to avoid a signed/unsigned
compare warning.

I was hoping this would allow us to remove the 'int' comparison
operators in Register.h and MCRegister.h, but compares with literal 0
still need them.
2024-09-18 09:54:21 -07:00
Rahul Joshi
0545e9f5b6
[LLVM][TableGen] Change DFAEmitter to use const Record pointers (#109042)
Change DFAEmitter to use const Record pointers.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:52:50 -07:00
Rahul Joshi
87da9e2fac
[LLVM][TableGen] Change CodeEmitterGen to use const RecordKeeper (#109025)
Change CodeEmitterGen to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 09:44:57 -07:00
Craig Topper
8e4909aa19
[RISCV] Remove unnecessary vand.vi from vXi1 and nvXvi1 VECTOR_REVERSE codegen. (#109071)
Use a setne with 0 instead of a trunc. We know we zero extended the node
so we can get by with a non-zero check only. The truncate lowering
doesn't know that we zero extended so has to mask the lsb.

I don't think DAG combine sees the trunc before we lower it to RISCVISD
nodes so we don't get a chance to use computeKnownBits to remove the
AND.
2024-09-18 09:43:48 -07:00
Craig Topper
292ee93a87
[CodeGen] Use Register in SwitchLoweringUtils. NFC (#109092)
Use an empty Register() instead of -1U.
2024-09-18 09:43:21 -07:00
weiguozhi
6b3c9e5c20
[X86] Speed up X86 Domain Reassignment pass by early return (#108108)
Current implementation of X86 Domain Reassignment pass is finding out
the complete closure of a general register, then check if it's possible
to change the domain. It causes compile time issue when compiling large
functions. This patch checks the possibility of change domain in the
process of constructing closure, if it's illegal to change domain, we
can return immedietely.

For one of our large files, it reduced X86 Domain Reassignment pass time
from 200+ seconds to less than 1s.
2024-09-18 09:12:04 -07:00
Rahul Joshi
2731be7ac5
[Support] Add helper struct indent for adding indentation (#108966)
Add helper struct indent() for adding indentation to raw_ostream.
2024-09-18 08:54:11 -07:00
Vakhurin Sergei
eda72fac54
Fix OOM in FormatDiagnostic (2nd attempt) (#108866)
Resolves: #70930 (and probably latest comments from clangd/clangd#251)
by fixing racing for the shared DiagStorage value which caused messing with args inside the storage and then formatting the following message with getArgSInt(1) == 2:

def err_module_odr_violation_function : Error<
  "%q0 has different definitions in different modules; "
  "%select{definition in module '%2'|defined here}1 "
  "first difference is "

which causes HandleSelectModifier to go beyond the ArgumentLen so the recursive call to FormatDiagnostic was made with DiagStr > DiagEnd that leads to infinite while (DiagStr != DiagEnd).

The Main Idea:
Reuse the existing DiagStorageAllocator logic to make all DiagnosticBuilders having independent states.
Also, encapsulating the rest of state (e.g. ID and Loc) into DiagnosticBuilder.

The last attempt failed -
https://github.com/llvm/llvm-project/pull/108187#issuecomment-2353122096
so was reverted - #108838
2024-09-18 11:46:25 -04:00
Jay Foad
2c85fe9689 [AMDGPU] Remove miscellaneous unused code. NFC. 2024-09-18 16:45:08 +01:00
Lei Huang
4b524088a8
[NFC] Update function names in MCTargetAsmParser.h (#108643)
Update function names to adhere to LLVM coding standard.
2024-09-18 11:43:49 -04:00
Jordan Rupprecht
afce1b1014
[bazel] Remove empty Rename tests for now-deleted clang-rename (#109162)
Removed in #108988, the tool is fine but the glob for tests is now empty
because all the tests were deleted.
2024-09-18 10:42:03 -05:00
Luc Blaeser
6ce14099ff
[lld][WebAssembly] Report unsupported PIC relocations as errors (#104926)
`WASM_MEMORY_ADDR_REL_` and `WASM_TABLE_INDEX_REL_` relocations against
**undefined symbols** are not supported and, except for
`UnresolvedPolicy::ReportError`, lead to incorrect Wasm code, such as
invalid data address or invalid table index that cannot be patched
during later dynamic Wasm linking with modules declaring those symbols.
This is different to other relocations that support undefined symbols by
declaring correspond Wasm imports.

For more robust behavior, `wasm-ld` should probably report an error for
such unsupported PIC relocations, independent of the `UnresolvedPolicy`.
2024-09-18 08:40:30 -07:00
Aaron Ballman
3f0dfab541
Revert "[clang] Increase VecLib bitfield size to 4 bits in CodeGenOptions.def" (#109161)
Reverts llvm/llvm-project#108804

Bots are failing:
https://lab.llvm.org/buildbot/#/builders/140/builds/6859
2024-09-18 11:34:09 -04:00
Mainak Sil
475ceca859
[clang] Increase VecLib bitfield size to 4 bits in CodeGenOptions.def (#108804)
Summary:
This PR fixes the issue where the VecLib bitfield in CodeGenOptions.def
is too small to accommodate the increasing number of vector libraries.
Specifically, the bitfield size was previously set to 3, but with the
introduction of more vector libraries (currently 9), the bitfield needed
to be expanded to avoid potential issues in vectorization.

In this PR, I have increased the size of the VecLib bitfield from 3 to 4
to account for the additional libraries. This ensures that all 9 vector
libraries are correctly encoded and available for use without errors.

Changes Made:
Modified: Increased the VecLib bitfield size from 3 to 4 in
clang/include/clang/Basic/CodeGenOptions.def.

Motivation:
This change is necessary to ensure that all vector libraries are
properly represented and selectable. The current limitation of the
VecLib bitfield size was causing some vectorization opportunities to be
lost when more than 3 bits were needed to represent the library options.

Closes:
Fixes https://github.com/llvm/llvm-project/issues/108704
2024-09-18 11:29:49 -04:00
Sarah Spall
67518a44fe
[HLSL] Implement elementwise popcount (#108121)
Add new elementwise popcount builtin to support HLSL function
'countbits'.
elementwise popcount only accepts integer types.
Add hlsl intrinsic 'countbits'
Closes #99094
2024-09-18 08:19:52 -07:00
Shilei Tian
b334ca6739 [NFC] Remove trailing whitespaces in llvm/docs/LangRef.rst 2024-09-18 10:26:40 -04:00
Rahul Joshi
47c3df2a7f
[LLVM][TableGen] Change CallingConvEmitter to use const RecordKeeper (#108955)
Change CallingConvEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 07:19:40 -07:00
Adrian Vogelsgesang
620738e662
[lldb-dap][test] Fix readMemory test (#109057)
So far, the test case was also testing the offset -1. This test cases
failed if the string is immediately at the beginning of the memory
region, though, and the offset -1 hence belonged to a different memory
region.

The fix is rather straightforward:
Passing an offset of -1 is not used by any actual clients of lldb-dap,
anyway. As such, this commit simply removes the corresponding test case.
2024-09-18 16:16:31 +02:00
Mariya Podchishchaeva
a9d9b0a03d
[clang][C23] Claim N3030 Enhancements to Enumerations supported (#107260)
Clang already implemented functionality as an extension.
2024-09-18 16:05:23 +02:00
Congcong Cai
11b95deab9 [clang-tidy][NFC] fix typo in clang-tools-extra/clang-tidy/modernize/LoopConvertCheck.cpp 2024-09-18 21:51:14 +08:00
Joseph Huber
ba8c96593c
[Clang] Do not implicitly link C libraries for the GPU targets (#109052)
Summary:
I initially thought that it would be convenient to automatically link
these libraries like they are for standard C/C++ targets. However, this
created issues when trying to use C++ as a GPU target. This patch moves
the logic to now implicitly pass it as part of the offloading toolchain
instead, if found. This means that the user needs to set the target
toolchain for the link job for automatic detection, but can still be
done manually via `-Xoffload-linker -lc`.
2024-09-18 06:44:07 -07:00
Florian Hahn
0d736e296c
[VPlan] Add getSCEVExprForVPValue util, use to get trip count SCEV (NFC) (#94464)
Add a new getSCEVExprForVPValue utility which can be used to get a SCEV
expression for a VPValue. The initial implementation only returns SCEVs
for live-in IR values (by constructing a SCEV based on the live-in IR
value) and VPExpandSCEVRecipe. This is enough to serve its first use,
getting a SCEV for a VPlan's trip count, but will be extended in the
future.

It also removes createTripCountSCEV, as the new helper can be used to
retrieve the SCEV from the VPlan.

PR: https://github.com/llvm/llvm-project/pull/94464
2024-09-18 14:41:56 +01:00
Nico Weber
ce74d5ff87 [gn build] Port a10c9f994be1 2024-09-18 09:40:04 -04:00
Phoebe Wang
a10c9f994b
Revert "[X86][BF16] Add libcall for F80 -> BF16" (#109140)
Reverts llvm/llvm-project#109116
2024-09-18 21:35:38 +08:00
Chris Apple
aa43f3abe0
[compiler-rt][rtsan] Use Die instead of exit, define cf.exitcode (#107635) 2024-09-18 07:34:18 -06:00
Nico Weber
07d7fdd7a5 [gn build] Port 311e4e324581 2024-09-18 09:28:23 -04:00
Nico Weber
e8e42999a5 [gn] port 76eda76f9f36 2024-09-18 09:27:49 -04:00
Phoebe Wang
76eda76f9f
[X86][BF16] Add libcall for F80 -> BF16 (#109116)
This fixes #108936, but the calling convention doesn't match with GCC. I
doubt we have such a lib function for now, so leave the calling
convention as is.
2024-09-18 21:23:10 +08:00
Nico Weber
5ac97d397c [gn] port 40c45b6b4318 more (rm clang-rename)
40c45b6b4318 already removed most traces of clang-rename from the
GN build (thanks!), but it didn't delete the build file for unit tests.
2024-09-18 09:16:19 -04:00
Nikita Popov
a4586bd2d4 [Loads] Extract some checks into a lambda (NFC)
This makes it easier to add additional checks.
2024-09-18 15:04:36 +02:00
Mahesh-Attarde
311e4e3245
[X86][AVX10.2] Support AVX10.2 MOVZXC new Instructions. (#108537)
Ref.: https://cdrdv2.intel.com/v1/dl/getContent/828965

Chapter 14 INTEL® AVX10 ZERO-EXTENDING PARTIAL VECTOR COPY INSTRUCTIONS

---------

Co-authored-by: mattarde <mattarde@intel.com>
2024-09-18 21:01:51 +08:00
Abid Qadeer
76347ee958
[flang][debug] Improve handling of dummy character arguments. (#108283)
As described in #107998, we were not handling the case well when length
of the character is not part of the type. This PR handles one of the
case when the length can be calculated by looking at the result of
corresponding `fir.unboxchar`.

The DIStringTypeAttr have a `stringLength` field that can be a variable.
We create an artificial variable that will hold the length and used as
value of `stringLength` field. The variable is then attached with
a `DbgValueOp`.

Fixes #107998.
2024-09-18 13:52:23 +01:00
Ilia Kuklin
9690b30ba9
[LLDB] Fix operators <= and >= returning a wrong result when comparing to a floating point NaN (#108060)
Implement operators `<=` and `>=` to explicitly check the comparison
results to be `cmpLessThan` or `cmpEqual` instead of negating the result
of `operators<`.

Fixes #85947
2024-09-18 17:50:09 +05:00
Nikita Popov
13b4d1bfea [SimplifyCFG][LICM] Add additional speculation tests
These are related to https://github.com/llvm/llvm-project/issues/108854.
2024-09-18 14:48:58 +02:00
Tulio Magno Quites Machado Filho
4eee0cfc8a
[MLIR] Reuse the path to runner_utils libraries (#108579)
Prefer to get the path to libmlir_runner_utils and
libmlir_c_runner_utils via %mlir_runner_utils and %mlir_c_runner_utils.
Fallback to the previous paths only if they aren't defined.

This ensures the test will pass regardless of the build configuration
used downstream.
2024-09-18 09:48:40 -03:00
Rahul Joshi
ef71226fcd
[LLVM][TableGen] Change WebAsm Emitter to use const RecordKeeper (#109051)
Change WebAssemblyDisassemblerEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 05:37:54 -07:00
Rahul Joshi
2bb3621faa
[LLVM][TableGen] Change DecoderEmitter to use const RecordKeeper (#109040)
Change DecoderEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089
2024-09-18 05:35:26 -07:00
Aaron Ballman
40c45b6b43
Remove clang-rename (#108988)
clang-rename has largely been superseded by clangd and this project
hasn't received much attention in many years. Further, our
documentation on it still claims it's in very early stages of
development despite being ~10 years old. One of the primary people
driving the tool has mentioned that they don't believe there is a
reason to continue to support it unless it's still being actively
used (https://reviews.llvm.org/D148439#4303202) and I've found no
evidence to suggest that is the case.

Original RFC:
https://discourse.llvm.org/t/rfc-time-to-deprecate-remove-clang-rename/70707
2024-09-18 08:25:58 -04:00