[ConstantFolding] Use ICmpInst::Predicate instead of plain integer
authorSerge Pavlov <sepavloff@gmail.com>
Wed, 29 Dec 2021 04:40:03 +0000 (11:40 +0700)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 30 Dec 2021 07:31:44 +0000 (14:31 +0700)
commitecfd9196d5dde5699d7fe3bd411949a56e01bd8c
tree0b17e3cc40e0a53fe4a3b8daf525dfd86407c219
parent5da6d26896d196cfbc992af32f82f8d2faf100c5
[ConstantFolding] Use ICmpInst::Predicate instead of plain integer

The function `ConstantFoldCompareInstruction` uses `unsigned short` to
represent compare predicate, although all usesrs of the respective
include file use definition of CmpInst also. This change replaces
predicate argument type in this function to `ICmpInst::Predicate`,
which allows to make code a bit clearer and simpler.

No functional changes.

Differential Revision: https://reviews.llvm.org/D116379
llvm/lib/IR/ConstantFold.cpp
llvm/lib/IR/ConstantFold.h
llvm/lib/IR/Constants.cpp