Skip to content

[TargetInstrInfo][NFC] Don't restrict isAddImmediate description to physical registers #72357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

asb
Copy link
Contributor

@asb asb commented Nov 15, 2023

None of the in-tree implementations have different behaviour for physical vs virtual registers, and it seems would work equally well if used with virtual registers. As such, perhaps it's simplest to just drop that part of the doc comment.

…hysical registers

None of the in-tree implementations have different behaviour for
physical vs virtual registers, and it seems would work equally well if
used with virtual registers. As such, perhaps it's simplest to just drop
that part of the doc comment.
@djtodoro
Copy link
Collaborator

LGTM.

asb added a commit that referenced this pull request Nov 16, 2023
This hook is called by the target-independent implementation of
TargetInstrInfo::describeLoadedValue. I've opted to test it via a C++
unit test, which although fiddly to set up seems the right way to test a
function with such clear intended semantics (rather than testing the
impact indirectly).

isAddImmediate will never recognise ADDIW as an add immediate which I
_think_ is conservatively correct, as the caller may not understand its
semantics vs ADDI.

Note that although the doc comment for isAddImmediate specifies its
behaviour solely in terms of physical registers, none of the current
in-tree implementations (including this one) bail out on virtual
registers (see #72357).
@asb asb merged commit 42d9232 into llvm:main Nov 16, 2023
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
This hook is called by the target-independent implementation of
TargetInstrInfo::describeLoadedValue. I've opted to test it via a C++
unit test, which although fiddly to set up seems the right way to test a
function with such clear intended semantics (rather than testing the
impact indirectly).

isAddImmediate will never recognise ADDIW as an add immediate which I
_think_ is conservatively correct, as the caller may not understand its
semantics vs ADDI.

Note that although the doc comment for isAddImmediate specifies its
behaviour solely in terms of physical registers, none of the current
in-tree implementations (including this one) bail out on virtual
registers (see llvm#72357).
sr-tream pushed a commit to sr-tream/llvm-project that referenced this pull request Nov 20, 2023
…hysical registers (llvm#72357)

None of the in-tree implementations have different behaviour for
physical vs virtual registers, and it seems would work equally well if
used with virtual registers. As such, perhaps it's simplest to just drop
that part of the doc comment.
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
This hook is called by the target-independent implementation of
TargetInstrInfo::describeLoadedValue. I've opted to test it via a C++
unit test, which although fiddly to set up seems the right way to test a
function with such clear intended semantics (rather than testing the
impact indirectly).

isAddImmediate will never recognise ADDIW as an add immediate which I
_think_ is conservatively correct, as the caller may not understand its
semantics vs ADDI.

Note that although the doc comment for isAddImmediate specifies its
behaviour solely in terms of physical registers, none of the current
in-tree implementations (including this one) bail out on virtual
registers (see llvm#72357).
zahiraam pushed a commit to zahiraam/llvm-project that referenced this pull request Nov 20, 2023
…hysical registers (llvm#72357)

None of the in-tree implementations have different behaviour for
physical vs virtual registers, and it seems would work equally well if
used with virtual registers. As such, perhaps it's simplest to just drop
that part of the doc comment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants