Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0 |
|
#
77f1b481 |
| 06-Sep-2024 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
DAG: Lower single infinity is.fpclass tests to fcmp (#100380)
InstCombine also should have taken care of this, but this should be helpful when the fcmp based lowering strategy tries to combine multi
DAG: Lower single infinity is.fpclass tests to fcmp (#100380)
InstCombine also should have taken care of this, but this should be helpful when the fcmp based lowering strategy tries to combine multiple tests.
show more ...
|
#
fc3e6a81 |
| 05-Sep-2024 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
DAG: Handle lowering unordered compare with inf (#100378)
Try to take advantage of the nan check behavior of fcmp. x86_64 looks better, x86_32 looks worse.
|
Revision tags: llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5 |
|
#
f6d431f2 |
| 24-Apr-2024 |
Xu Zhang <simonzgx@gmail.com> |
[CodeGen] Make the parameter TRI required in some functions. (#85968)
Fixes #82659
There are some functions, such as `findRegisterDefOperandIdx` and `findRegisterDefOperand`, that have too many
[CodeGen] Make the parameter TRI required in some functions. (#85968)
Fixes #82659
There are some functions, such as `findRegisterDefOperandIdx` and `findRegisterDefOperand`, that have too many default parameters. As a result, we have encountered some issues due to the lack of TRI parameters, as shown in issue #82411.
Following @RKSimon 's suggestion, this patch refactors 9 functions, including `{reads, kills, defines, modifies}Register`, `registerDefIsDead`, and `findRegister{UseOperandIdx, UseOperand, DefOperandIdx, DefOperand}`, adjusting the order of the TRI parameter and making it required. In addition, all the places that call these functions have also been updated correctly to ensure no additional impact.
After this, the caller of these functions should explicitly know whether to pass the `TargetRegisterInfo` or just a `nullptr`.
show more ...
|
Revision tags: llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2 |
|
#
b59022b4 |
| 06-Feb-2023 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
DAG: Handle lowering of unordered fcZero|fcSubnormal to fcmp
|
#
64df9573 |
| 02-Feb-2023 |
Matt Arsenault <Matthew.Arsenault@amd.com> |
DAG: Handle inversion of fcSubnormal | fcZero
There are a number of more test combinations here that can be done together and reduce the number of instructions.
https://reviews.llvm.org/D143191
|
#
7f81dd4d |
| 24-Feb-2023 |
Serge Pavlov <sepavloff@gmail.com> |
[NFC] Make FPClassTest a bitmask enumeration
This is recommit of 2e416cdd52, fixed to be accepatble by GCC. The original commit message is below.
With this change bitwise operations are allowed for
[NFC] Make FPClassTest a bitmask enumeration
This is recommit of 2e416cdd52, fixed to be accepatble by GCC. The original commit message is below.
With this change bitwise operations are allowed for FPClassTest enumeration, it must simplify using this type. Also some functions changed to get argument of type FPClassTest instead of unsigned.
Differential Revision: https://reviews.llvm.org/D144241
show more ...
|
#
08a09235 |
| 23-Feb-2023 |
Serge Pavlov <sepavloff@gmail.com> |
Revert "[NFC] Make FPClassTest a bitmask enumeration"
This reverts commit e7613c1d9b259bdf2b0b06b4169d9a10dd553406.
GCC issues an error:
In file included from /home/buildbot/as-builder-4/lld-x86_6
Revert "[NFC] Make FPClassTest a bitmask enumeration"
This reverts commit e7613c1d9b259bdf2b0b06b4169d9a10dd553406.
GCC issues an error:
In file included from /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/unittests/ADT/BitmaskEnumTest.cpp:9: /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/include/llvm/ADT/BitmaskEnum.h:66:22: error: explicit specialization of template<class E, class Enable> struct llvm::is_bitmask_enum outside its namespace must use a nested-name-specifier [-fpermissive] 66 | template <> struct is_bitmask_enum<Enum> : std::true_type {}; \ | ^~~~~~~~~~~~~~~~~~~~~ /home/buildbot/as-builder-4/lld-x86_64-ubuntu-fast/llvm-project/llvm/unittests/ADT/BitmaskEnumTest.cpp:30:1: note: in expansion of macro LLVM_DECLARE_ENUM_AS_BITMASK 30 | LLVM_DECLARE_ENUM_AS_BITMASK(Flags2, V4); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
show more ...
|
#
e7613c1d |
| 22-Feb-2023 |
Serge Pavlov <sepavloff@gmail.com> |
[NFC] Make FPClassTest a bitmask enumeration
This is recommit of 2e416cdd52, reverted in 8555ab2fcd, because GCC complains on extra qualification. The macro LLVM_DECLARE_ENUM_AS_BITMASK does not spe
[NFC] Make FPClassTest a bitmask enumeration
This is recommit of 2e416cdd52, reverted in 8555ab2fcd, because GCC complains on extra qualification. The macro LLVM_DECLARE_ENUM_AS_BITMASK does not specify llvm:: anymore, so the macro must occur in the namespace llvm. Documentation updated accordingly. The original commit message is below.
With this change bitwise operations are allowed for FPClassTest enumeration, it must simplify using this type. Also some functions changed to get argument of type FPClassTest instead of unsigned.
Differential Revision: https://reviews.llvm.org/D144241
show more ...
|
#
8555ab2f |
| 22-Feb-2023 |
Nikita Popov <npopov@redhat.com> |
Revert "[NFC] Make FPClassTest a bitmask enumeration"
This reverts commit 2e416cdd52c1079b8c7cb1f7d7e557c889a4fb56.
Breaks the GCC build:
In file included from /home/npopov/repos/llvm-project/llvm
Revert "[NFC] Make FPClassTest a bitmask enumeration"
This reverts commit 2e416cdd52c1079b8c7cb1f7d7e557c889a4fb56.
Breaks the GCC build:
In file included from /home/npopov/repos/llvm-project/llvm/include/llvm/ADT/FloatingPointMode.h:18, from /home/npopov/repos/llvm-project/llvm/include/llvm/ADT/APFloat.h:20, from /home/npopov/repos/llvm-project/llvm/lib/Support/APFloat.cpp:14: /home/npopov/repos/llvm-project/llvm/include/llvm/ADT/BitmaskEnum.h:66:22: error: extra qualification not allowed [-fpermissive] 66 | template <> struct llvm::is_bitmask_enum<Enum> : std::true_type {}; \ | ^~~~ /home/npopov/repos/llvm-project/llvm/include/llvm/ADT/FloatingPointMode.h:223:1: note: in expansion of macro ‘LLVM_DECLARE_ENUM_AS_BITMASK’ 223 | LLVM_DECLARE_ENUM_AS_BITMASK(FPClassTest, /* LargestValue */ fcPosInf); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/npopov/repos/llvm-project/llvm/include/llvm/ADT/BitmaskEnum.h:67:22: error: extra qualification not allowed [-fpermissive] 67 | template <> struct llvm::largest_bitmask_enum_bit<Enum> { \ | ^~~~ /home/npopov/repos/llvm-project/llvm/include/llvm/ADT/FloatingPointMode.h:223:1: note: in expansion of macro ‘LLVM_DECLARE_ENUM_AS_BITMASK’ 223 | LLVM_DECLARE_ENUM_AS_BITMASK(FPClassTest, /* LargestValue */ fcPosInf); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ [43/4396] Building CXX object lib/Supp...iles/LLVMSupport.dir/CommandLine.cpp.o
show more ...
|
#
2e416cdd |
| 22-Feb-2023 |
Serge Pavlov <sepavloff@gmail.com> |
[NFC] Make FPClassTest a bitmask enumeration
With this change bitwise operations are allowed for FPClassTest enumeration, it must simplify using this type. Also some functions changed to get argumen
[NFC] Make FPClassTest a bitmask enumeration
With this change bitwise operations are allowed for FPClassTest enumeration, it must simplify using this type. Also some functions changed to get argument of type FPClassTest instead of unsigned.
Differential Revision: https://reviews.llvm.org/D144241
show more ...
|
Revision tags: llvmorg-16.0.0-rc1, llvmorg-17-init |
|
#
e72ca520 |
| 13-Jan-2023 |
Craig Topper <craig.topper@sifive.com> |
[CodeGen] Remove uses of Register::isPhysicalRegister/isVirtualRegister. NFC
Use isPhysical/isVirtual methods.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D141715
|
Revision tags: llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2 |
|
#
facb3ac3 |
| 01-Aug-2022 |
Vladislav Dzhidzhoev <vdzhidzhoev@accesssoftek.com> |
[GlobalISel][DebugInfo] salvageDebugInfo analogue for gMIR
Salvage debug info of instruction that is about to be deleted as dead in Combiner pass. Currently supported instructions are COPY and G_TRU
[GlobalISel][DebugInfo] salvageDebugInfo analogue for gMIR
Salvage debug info of instruction that is about to be deleted as dead in Combiner pass. Currently supported instructions are COPY and G_TRUNC.
It allows to salvage debug info of some dead arguments of functions, by putting DWARF expression corresponding to the instruction being deleted into related DBG_VALUE instruction.
Here is an example of missing variables location https://godbolt.org/z/K48osb9dK. We see that arguments x, y of function foo are not available in debugger, and corresponding DBG_VALUE instructions have undefined register operand instead of variables locaton after Aarch64PreLegalizerCombiner pass. The reason is that registers where variables are located are removed as dead (with instruction G_TRUNC). We can use salvageDebugInfo analogue for gMIR to preserve debug locations of dead variables.
Statistics of llvm object files built with vs without this commit on -O2 optimization level (CMAKE_BUILD_TYPE=RelWithDebInfo, -fglobal-isel) on Aarch64 (macOS):
Number of variables with 100% of parent scope covered by DW_AT_location has been increased by 7,9%. Number of variables with 0% coverage of parent scope has been decreased by 1,2%. Number of variables processed by location statistics has been increased by 2,9%. Average PC ranges coverage has been increased by 1,8 percentage points.
Coverage can be improved by supporting more instructions, or by calling salvageDebugInfo for instructions that are deleted during Combiner rules exection.
Reviewed By: aprantl
Differential Revision: https://reviews.llvm.org/D129909
show more ...
|
Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6, llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1 |
|
#
170a9031 |
| 10-Oct-2021 |
Serge Pavlov <sepavloff@gmail.com> |
Intrinsic for checking floating point class
This change introduces a new intrinsic, `llvm.is.fpclass`, which checks if the provided floating-point number belongs to any of the the specified value cl
Intrinsic for checking floating point class
This change introduces a new intrinsic, `llvm.is.fpclass`, which checks if the provided floating-point number belongs to any of the the specified value classes. The intrinsic implements the checks made by C standard library functions `isnan`, `isinf`, `isfinite`, `isnormal`, `issubnormal`, `issignaling` and corresponding IEEE-754 operations.
The primary motivation for this intrinsic is the support of strict FP mode. In this mode using compare instructions or other FP operations is not possible, because if the value is a signaling NaN, floating-point exception `Invalid` is raised, but the aforementioned functions must never raise exceptions.
Currently there are two solutions for this problem, both are implemented partially. One of them is using integer operations to implement the check. It was implemented in https://reviews.llvm.org/D95948 for `isnan`. It solves the problem of exceptions, but offers one solution for all targets, although some can do the check in more efficient way.
The other, implemented in https://reviews.llvm.org/D96568, introduced a hook 'clang::TargetCodeGenInfo::testFPKind', which injects a target specific code into IR to implement `isnan` and some other functions. It is convenient for targets that have dedicated instruction to determine FP data class. However using target-specific intrinsic complicates analysis and can prevent some optimizations.
A special intrinsic for value class checks allows representing data class tests with enough flexibility. During IR transformations it represents the check in target-independent way and saves it from undesired transformations. In the instruction selector it allows efficient lowering depending on the used target and mode.
This implementation is an extended variant of `llvm.isnan` introduced in https://reviews.llvm.org/D104854. It is limited to minimal intrinsic support. Target-specific treatment will be implemented in separate patches.
Differential Revision: https://reviews.llvm.org/D112025
show more ...
|
#
a87d3ba6 |
| 10-Feb-2022 |
Tim Northover <tnorthover@apple.com> |
Reapply: StackProtector: ignore debug insts when splitting blocks.
When deciding where to split a block to insert stack guard checks, we should move past any debug instructions we see that might (e.
Reapply: StackProtector: ignore debug insts when splitting blocks.
When deciding where to split a block to insert stack guard checks, we should move past any debug instructions we see that might (e.g.) be separating a tail call from its frame wrangling.
This time, also don't run off the front of a basic block.
show more ...
|
#
2ba06bed |
| 11-Feb-2022 |
Tim Northover <t.p.northover@gmail.com> |
Revert "StackProtector: ignore debug insts when splitting blocks."
This reverts commit 7605ca85f1a8e4e61e7de98856630d67da11aaae.
It caused an assertion failure in Fuschia.
|
#
7605ca85 |
| 10-Feb-2022 |
Tim Northover <tnorthover@apple.com> |
StackProtector: ignore debug insts when splitting blocks.
When deciding where to split a block to insert stack guard checks, we should move past any debug instructions we see that might (e.g.) be se
StackProtector: ignore debug insts when splitting blocks.
When deciding where to split a block to insert stack guard checks, we should move past any debug instructions we see that might (e.g.) be separating a tail call from its frame wrangling.
show more ...
|
#
d8e4170b |
| 23-Oct-2021 |
Kazu Hirata <kazu@google.com> |
Ensure newlines at the end of files (NFC)
|
#
cfef1803 |
| 26-Sep-2021 |
Amara Emerson <amara@apple.com> |
[GlobalISel] Port over the SelectionDAG stack protector codegen feature.
This is a port of the feature that allows the StackProtector pass to omit checking code for stack canary checks, and rely on
[GlobalISel] Port over the SelectionDAG stack protector codegen feature.
This is a port of the feature that allows the StackProtector pass to omit checking code for stack canary checks, and rely on SelectionDAG to do it at a later stage. The reasoning behind this seems to be to prevent the IR checking instructions from hindering tail-call optimizations during codegen.
Here we allow GlobalISel to also use that scheme. Doing so requires that we do some analysis using some factored-out code to determine where to generate code for the epilogs.
Not every case is handled in this patch since we don't have support for all targets that exercise different stack protector schemes.
Differential Revision: https://reviews.llvm.org/D98200
show more ...
|