Skip to content
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

[IR] Add zext nneg flag #67982

Merged
merged 3 commits into from
Oct 30, 2023
Merged

[IR] Add zext nneg flag #67982

merged 3 commits into from
Oct 30, 2023

Commits on Oct 18, 2023

  1. [IR] Add zext nneg flag

    Add an nneg flag to the zext instruction, which specifies that the
    argument is non-negative. Otherwise, the result is a poison value.
    
    The primary use-case for the flag is to preserve information when
    sext gets replaced with zext due to range-based canonicalization.
    The nneg flag allows us to convert the zext back into an sext
    later. This is useful for some optimizations (e.g. a signed icmp
    can fold with sext but not zext), as well as some targets (e.g.
    RISCV prefers sext over zext).
    
    Co-authored-by: Nikita Popov <npopov@redhat.com>
    karouzakisp and nikic committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    1e06e41 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    55d512b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    32a20d7 View commit details
    Browse the repository at this point in the history