[Constant] Inline ConstantInt::getSigned
authorCraig Topper <craig.topper@sifive.com>
Wed, 22 Mar 2023 16:31:51 +0000 (09:31 -0700)
committerCraig Topper <craig.topper@sifive.com>
Wed, 22 Mar 2023 16:31:51 +0000 (09:31 -0700)
commit83e420c65f4a6c0b693af82cfd81ae58fd033f97
tree918ab901bfca5ce082b036edf420311434f9fc27
parent8eb464f5433ae65bec3536ddb1195e5ff5c46af0
[Constant] Inline ConstantInt::getSigned

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.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D146598
llvm/include/llvm/IR/Constants.h
llvm/lib/IR/Constants.cpp