This is an archive of the discontinued LLVM Phabricator instance.

[Constant] Inline ConstantInt::getSigned
ClosedPublic

Authored by craig.topper on Mar 21 2023, 7:55 PM.

Details

Summary

ConstantInt::getSigned calls ConstantInt::get with the IsSigned flag set to true.
That flag normally defaults to false.

For always signed constants the code base is not consistent about whether
it uses ConstantInt::getSigned or ConstantInt::get with IsSigned set to true.
And it's not clear how to decide which way to use.

By making getSigned inline, both ways should generate the same code in
the end.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 21 2023, 7:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 7:55 PM
craig.topper requested review of this revision.Mar 21 2023, 7:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 21 2023, 7:55 PM
nikic accepted this revision.Mar 22 2023, 1:08 AM

LGTM

This revision is now accepted and ready to land.Mar 22 2023, 1:08 AM
This revision was landed with ongoing or failed builds.Mar 22 2023, 9:32 AM
This revision was automatically updated to reflect the committed changes.