forked from OSchip/llvm-project
[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:
parent
d89f9e963e
commit
37c0aacd71
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue