[all-commits] [llvm/llvm-project] 83e420: [Constant] Inline ConstantInt::getSigned

Craig Topper via All-commits all-commits at lists.llvm.org
Wed Mar 22 09:32:09 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 83e420c65f4a6c0b693af82cfd81ae58fd033f97
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-03-22 (Wed, 22 Mar 2023)

  Changed paths:
    M llvm/include/llvm/IR/Constants.h
    M llvm/lib/IR/Constants.cpp

  Log Message:
  [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

More information about the All-commits mailing list