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

Cherry pick fixes for large signed constant truncation #630

Merged
merged 3 commits into from
Jun 27, 2024

Commits on Jun 19, 2024

  1. Configuration menu
    Copy the full SHA
    dd86bb2 View commit details
    Browse the repository at this point in the history
  2. [LoopUnroll] Fix missing sign extension

    For integers larger than 64-bit, this would zero-extend a -1
    value, instead of sign-extending it.
    
    Fixes llvm/llvm-project#80289.
    nikic authored and vladimirradosavljevic committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    007169b View commit details
    Browse the repository at this point in the history
  3. Assert correct values in APInt constructor

    If the uint64_t constructor is used, assert that the value is
    actuall a signed or unsigned N-bit integer depending on whether
    the isSigned flag is set.
    
    Currently, we allow values to be silently truncated, which is
    a constant source of subtle bugs -- a particularly common mistake
    is to create -1 values without setting the isSigned flag, which
    will work fine for all common bit widths (<= 64-bit) and miscompile
    for larger integers.
    nikic authored and vladimirradosavljevic committed Jun 19, 2024
    Configuration menu
    Copy the full SHA
    86e4253 View commit details
    Browse the repository at this point in the history