History log of /llvm-project/llvm/lib/CodeGen/RegAllocFast.cpp (Results 1 – 25 of 290)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# f5f32cef 21-Jan-2025 Craig Topper <craig.topper@sifive.com>

[CodeGen] Use MCRegister instead of MCPhysReg in RegisterMaskPair. NFC (#123688)

Update some other places to avoid implicit conversions this introduces,
but I probably missed some.


# c3d82055 21-Jan-2025 Craig Topper <craig.topper@sifive.com>

[RegAllocFast] Don't convert MCRegUnit to MCRegister. NFC (#123705)


Revision tags: llvmorg-19.1.7
# e8a65637 17-Dec-2024 Thurston Dang <thurston@google.com>

Fix-forward 'RegAllocFast: Avoid using temporary DiagnosticInfo #120184' (#120268)

There was a buildbot breakage

(https://lab.llvm.org/buildbot/#/builders/24/builds/3329/steps/11/logs/stdio):

Fix-forward 'RegAllocFast: Avoid using temporary DiagnosticInfo #120184' (#120268)

There was a buildbot breakage

(https://lab.llvm.org/buildbot/#/builders/24/builds/3329/steps/11/logs/stdio):


/home/b/sanitizer-aarch64-linux-bootstrap-asan/build/llvm-project/llvm/test/CodeGen/AMDGPU/ran-out-of-registers-error-all-regs-reserved.ll:9:10:
error: CHECK: expected string not found in input
; CHECK: error: <unknown>:0:0: no registers from class available to
allocate in function 'no_registers_from_class_available_to_allocate'

2: ==75198==ERROR: AddressSanitizer: stack-use-after-scope on address
0xfa23f9f1c270 at pc 0xb2660dda9340 bp 0xfffffe8ab340 sp 0xfffffe8ab338

caused by https://github.com/llvm/llvm-project/pull/120184, which made a
partial fix but also renabled the tests. This patch attempts to fix
forward by applying the same fix to the error message highlighted in the
buildbot.

show more ...


Revision tags: llvmorg-19.1.6
# 3508d8f6 17-Dec-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

RegAllocFast: Avoid using temporary DiagnosticInfo (#120184)

This reverts commit 1297933f35b4948b4d281259627a72094c407a75.


# 818bffcb 16-Dec-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

RegAlloc: Fix failure on undef use when all registers are reserved (#119647)

Greedy and fast would hit different assertions on undef uses if all
registers in a class were reserved.


# 61f99a1c 16-Dec-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

RegAlloc: Do not fatal error if there are no registers in the alloc order (#119640)

Try to use DiagnosticInfo if every register in the class is reserved
by forcing assignment to a reserved register.

RegAlloc: Do not fatal error if there are no registers in the alloc order (#119640)

Try to use DiagnosticInfo if every register in the class is reserved
by forcing assignment to a reserved register. Also reduces the number
of redundant errors emitted, particularly with fast.

This is still broken in the case of undef uses. There are additional
complications in greedy and fast, so leave it for a separate fix.

show more ...


# bb18e49e 16-Dec-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

RegAlloc: Use DiagnosticInfo to report register allocation failures (#119492)

Improve the non-fatal cases to use DiagnosticInfo, which will now
provide a location. The allocators attempt to report d

RegAlloc: Use DiagnosticInfo to report register allocation failures (#119492)

Improve the non-fatal cases to use DiagnosticInfo, which will now
provide a location. The allocators attempt to report different errors
if it happens to see inline assembly is involved (this detection is
quite unreliable) using srcloc instead of dbgloc. For now, leave this
behavior unchanged. I think reporting the full location and context
function would be more useful.

show more ...


# ea632e1b 12-Dec-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

Reapply "DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm" (#119575) (#119634)

This reverts commit 40986feda8b1437ed475b144d5b9a208b008782a.

Reapply with fix to prevent temporary Twine fro

Reapply "DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm" (#119575) (#119634)

This reverts commit 40986feda8b1437ed475b144d5b9a208b008782a.

Reapply with fix to prevent temporary Twine from going out of scope.

show more ...


# 40986fed 11-Dec-2024 Vitaly Buka <vitalybuka@google.com>

Revert "DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm" (#119575)

Reverts llvm/llvm-project#119485

Breaks builders, details in llvm/llvm-project#119485


# 884f2ad6 11-Dec-2024 Matt Arsenault <Matthew.Arsenault@amd.com>

DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm (#119485)

Currently LLVMContext::emitError emits any error as an "inline asm"
error which does not make any sense. InlineAsm appears to be s

DiagnosticInfo: Clean up usage of DiagnosticInfoInlineAsm (#119485)

Currently LLVMContext::emitError emits any error as an "inline asm"
error which does not make any sense. InlineAsm appears to be special,
in that it uses a "LocCookie" from srcloc metadata, which looks like
a parallel mechanism to ordinary source line locations. This meant
that other types of failures had degraded source information reported
when available.

Introduce some new generic error types, and only use inline asm
in the appropriate contexts. The DiagnosticInfo types are still
a bit of a mess, and I'm not sure why DiagnosticInfoWithLocationBase
exists instead of just having an optional DiagnosticLocation in the
base class.

DK_Generic is for any error that derives from an IR level instruction,
and thus can pull debug locations directly from it. DK_GenericWithLoc
is functionally the generic codegen error, since it does not depend
on the IR and instead can construct a DiagnosticLocation from the
MI debug location.

show more ...


Revision tags: llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 02813391 28-Aug-2024 Vitaly Buka <vitalybuka@google.com>

Revert "[CodeGen] Use MachineInstr::{all_uses,all_defs} (NFC)" (#106451)

Reverts llvm/llvm-project#106404

Breaks:
https://lab.llvm.org/buildbot/#/builders/169/builds/2590
https://lab.llvm.org/b

Revert "[CodeGen] Use MachineInstr::{all_uses,all_defs} (NFC)" (#106451)

Reverts llvm/llvm-project#106404

Breaks:
https://lab.llvm.org/buildbot/#/builders/169/builds/2590
https://lab.llvm.org/buildbot/#/builders/164/builds/2454

show more ...


# a4989cd6 28-Aug-2024 Kazu Hirata <kazu@google.com>

[CodeGen] Use MachineInstr::{all_uses,all_defs} (NFC) (#106404)


# 399d7cce 26-Aug-2024 Kazu Hirata <kazu@google.com>

[CodeGen] Use MachineInstr::all_defs (NFC) (#106017)


Revision tags: llvmorg-19.1.0-rc3
# 3e806c82 09-Aug-2024 Pratyay Pande <pratyay.pande@intel.com>

[NFC] Use references to avoid copying (#99863)

Modifying `auto` to `auto&` to avoid unnecessary copying


Revision tags: llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 15b41d20 22-Jul-2024 Christudasan Devadasan <christudasan.devadasan@amd.com>

[CodeGen] change prototype of regalloc filter function (#93525)

[CodeGen] Change the prototype of regalloc filter function

Change the prototype of the filter function so that we can
filter not j

[CodeGen] change prototype of regalloc filter function (#93525)

[CodeGen] Change the prototype of regalloc filter function

Change the prototype of the filter function so that we can
filter not just by RegClass. We need to implement more
complicated filter based upon some other info associated
with each register.

Patch provided by: Gang Chen (gangc@amd.com)

show more ...


# 8e9c6bfb 22-Jun-2024 paperchalice <liujunchang97@outlook.com>

[CodeGen][NewPM] Extract MachineFunctionProperties modification part to an RAII class (#94854)

Modify MachineFunctionProperties in PassModel makes `PassT P;
P.run(...);` not work properly. This is

[CodeGen][NewPM] Extract MachineFunctionProperties modification part to an RAII class (#94854)

Modify MachineFunctionProperties in PassModel makes `PassT P;
P.run(...);` not work properly. This is a necessary compromise.

show more ...


# f4cf15d2 21-Jun-2024 Alexis Engelke <engelke@in.tum.de>

[RegAllocFast] Replace UsedInInstr with vector (#96323)

A SparseSet adds an avoidable layer of indirection and possibly looping
control flow. Avoid this overhead by using a vector to store
UsedInI

[RegAllocFast] Replace UsedInInstr with vector (#96323)

A SparseSet adds an avoidable layer of indirection and possibly looping
control flow. Avoid this overhead by using a vector to store
UsedInInstrs and PhysRegUses.

To avoid clearing the vector after every instruction, use a
monotonically increasing counter. The two maps are now merged and the
lowest bit indicates whether the use is relevant for the livethrough
handling code only.

show more ...


# 739a9605 21-Jun-2024 Alexis Engelke <engelke@in.tum.de>

[RegAlloc] Don't call always-true ShouldAllocClass (#96296)

Previously, there was at least one virtual function call for every
allocated register. The only users of this feature are AMDGPU and RISC

[RegAlloc] Don't call always-true ShouldAllocClass (#96296)

Previously, there was at least one virtual function call for every
allocated register. The only users of this feature are AMDGPU and RISC-V
(RVV), other targets don't use this. To easily identify these cases,
change the default functor to nullptr and don't call it for every
allocated register.

show more ...


# 0ae6cfc5 21-Jun-2024 Alexis Engelke <engelke@in.tum.de>

[RegAllocFast] Handle single-vdef instrs faster (#96284)

On x86, many instructions have tied operands, so allocateInstruction
uses the more complex assignment strategy, which computes the assignmen

[RegAllocFast] Handle single-vdef instrs faster (#96284)

On x86, many instructions have tied operands, so allocateInstruction
uses the more complex assignment strategy, which computes the assignment
order of virtual defs first. This involves iterating over all register
classes (or register aliases for physical defs) to compute the possible
number of defs per register class.

However, this information is only used for sorting virtual defs and
therefore not required when there's only one virtual def -- which is a
very common case. As iterating over all register classes/aliases is not
cheap, do this only when there's more than one virtual def.

show more ...


# cba4dfdd 21-Jun-2024 Alexis Engelke <engelke@in.tum.de>

[RegAllocFast] Use unsigned for operand indices

MachineInstr operand indices can be up 24 bits currently. Use unsigned
as consistent data type for operand indices instead of uint16_t.


Revision tags: llvmorg-18.1.8
# 1bc8b325 07-Jun-2024 paperchalice <liujunchang97@outlook.com>

[NewPM][CodeGen] Port `regallocfast` to new pass manager (#94426)

This pull request port `regallocfast` to new pass manager. It exposes
the parameter `filter` to handle different register classes f

[NewPM][CodeGen] Port `regallocfast` to new pass manager (#94426)

This pull request port `regallocfast` to new pass manager. It exposes
the parameter `filter` to handle different register classes for AMDGPU.
IIUC AMDGPU need to allocate different register classes separately so it
need implement its own `--<reg-class>-regalloc`. Now users can use e.g.
`-passe=regallocfast<filter=sgpr>` to allocate specific register class.
The command line option `--regalloc-npm` is still in work progress, plan
to reuse the syntax of passes, e.g. use
`--regalloc-npm=regallocfast<filter=sgpr>,greedy<filter=vgpr>` to
replace `--sgpr-regalloc` and `--vgpr-regalloc`.

show more ...


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2
# 63a5dc4a 11-Mar-2024 Jay Foad <jay.foad@amd.com>

[CodeGen] Do not pass MF into MachineRegisterInfo methods. NFC. (#84770)

MachineRegisterInfo already knows the MF so there is no need to pass it
in as an argument.


Revision tags: 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
# 536b0432 25-Dec-2023 HaohaiWen <haohai.wen@intel.com>

[RegAllocFast] Lazily initialize InstrPosIndexes for each MBB (#76275)

Most basic block do not need to query dominates. Defer initialization of
InstrPosIndexes to first query for each MBB.


# d82eccc7 22-Dec-2023 Nikita Popov <npopov@redhat.com>

[RegAllocFast] Avoid duplicate hash lookup (NFC)


# 40ec791b 22-Dec-2023 HaohaiWen <haohai.wen@intel.com>

[RegAllocFast] Refactor dominates algorithm for large basic block (#72250)

The original brute force dominates algorithm is O(n) complexity so it is
very slow for very large machine basic block whic

[RegAllocFast] Refactor dominates algorithm for large basic block (#72250)

The original brute force dominates algorithm is O(n) complexity so it is
very slow for very large machine basic block which is very common with
O0. This patch added InstrPosIndexes to assign index for each
instruction and use it to determine dominance. The complexity is now
O(1).

show more ...


12345678910>>...12