Skip to content

Conversation

@AnthonyLatsis
Copy link
Collaborator

See llvm/llvm-project#114539.

The approach taken in the reverted commit is causing tests to fail, and I am not positive that all instances of the -1 to 1 switch are correct. Restore the old behavior by tweaking the ctor call instead.

… ctor"

The approach taken in the reverted commit is causing tests to fail, and
I am not positive that all instances of the -1 to 1 switch are correct.
A subsequent commit will restore the old behavior by tweaking the ctor
call instead.

This reverts commit 657f502.
Copy link
Contributor

@bnbarham bnbarham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to take for now to unblock things, but would be good to get @aschwaighofer / @drexin to weigh in on the truncation (even if that's just to remove the TODO).

@AnthonyLatsis AnthonyLatsis merged commit 3e99010 into swiftlang:rebranch May 13, 2025
@AnthonyLatsis AnthonyLatsis deleted the rebranch branch May 13, 2025 06:00
AnthonyLatsis added a commit that referenced this pull request Aug 21, 2025
Follow-up to #81464.
Fixes an assertion failure on 32-bit Windows.

The default value was flipped in
llvm/llvm-project#114539.
return APInt(intTy->getGreatestWidth(), value);
// TODO: Avoid implicit trunc?
return APInt(intTy->getGreatestWidth(), value, /*isSigned=*/false,
/*implicitTrunc=*/true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're getting implicit truncation here, I feel like that's genuinely problematic and we should get an assertion.

SILValue minusOne = B.createIntegerLiteral(loc, i1, -1);
booleanTestValue =
B.createBuiltinBinaryFunction(loc, "xor", i1, i1,
{booleanTestValue, minusOne});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We conventionally talk about single bits as 0 and 1, not 0 and -1. So I don't like the renaming, and if we've done something to make it necessary to pass -1 instead of 1 to the constructor here, that seems bad.

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.

3 participants