diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
| -rw-r--r-- | contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 12 | 
1 files changed, 10 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index 1d0a03ccfcdc..03cba892a167 100644 --- a/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/contrib/llvm-project/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -64,11 +64,18 @@ static ISD::NodeType getPreferredExtendForValue(const Instruction *I) {    // can be exposed.    ISD::NodeType ExtendKind = ISD::ANY_EXTEND;    unsigned NumOfSigned = 0, NumOfUnsigned = 0; -  for (const User *U : I->users()) { -    if (const auto *CI = dyn_cast<CmpInst>(U)) { +  for (const Use &U : I->uses()) { +    if (const auto *CI = dyn_cast<CmpInst>(U.getUser())) {        NumOfSigned += CI->isSigned();        NumOfUnsigned += CI->isUnsigned();      } +    if (const auto *CallI = dyn_cast<CallBase>(U.getUser())) { +      if (!CallI->isArgOperand(&U)) +        continue; +      unsigned ArgNo = CallI->getArgOperandNo(&U); +      NumOfUnsigned += CallI->paramHasAttr(ArgNo, Attribute::ZExt); +      NumOfSigned += CallI->paramHasAttr(ArgNo, Attribute::SExt); +    }    }    if (NumOfSigned > NumOfUnsigned)      ExtendKind = ISD::SIGN_EXTEND; @@ -350,6 +357,7 @@ void FunctionLoweringInfo::clear() {    StatepointRelocationMaps.clear();    PreferredExtendType.clear();    PreprocessedDbgDeclares.clear(); +  PreprocessedDPVDeclares.clear();  }  /// CreateReg - Allocate a single virtual register for the given type.  | 
