[SelectionDAG] Make getPreferredExtendForValue take a Instruction * instead of Value *.

This is only called for instructions and the caller is already holding
an Instruction *. This makes the code more explicit and makes it
obvious the code doesn't make decisions about constants.
This commit is contained in:
Craig Topper 2022-03-21 12:08:56 -07:00
parent d89f9e963e
commit 37c0aacd71
1 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ static bool isUsedOutsideOfDefiningBlock(const Instruction *I) {
return false;
}
static ISD::NodeType getPreferredExtendForValue(const Value *V) {
static ISD::NodeType getPreferredExtendForValue(const Instruction *I) {
// For the users of the source value being used for compare instruction, if
// the number of signed predicate is greater than unsigned predicate, we
// prefer to use SIGN_EXTEND.
@ -64,7 +64,7 @@ static ISD::NodeType getPreferredExtendForValue(const Value *V) {
// can be exposed.
ISD::NodeType ExtendKind = ISD::ANY_EXTEND;
unsigned NumOfSigned = 0, NumOfUnsigned = 0;
for (const User *U : V->users()) {
for (const User *U : I->users()) {
if (const auto *CI = dyn_cast<CmpInst>(U)) {
NumOfSigned += CI->isSigned();
NumOfUnsigned += CI->isUnsigned();