diff --git a/eng/native/configurecompiler.cmake b/eng/native/configurecompiler.cmake index a5dac887902eb..27d69d544d75b 100644 --- a/eng/native/configurecompiler.cmake +++ b/eng/native/configurecompiler.cmake @@ -502,59 +502,44 @@ if (MSVC) add_compile_options($<$:/Zc:inline>) # All inline functions must have their definition available in the current translation unit. add_compile_options($<$:/Zc:forScope>) # Enforce standards-compliant for scope. - add_compile_options($<$:/wd4960>) - add_compile_options($<$:/wd4961>) - add_compile_options($<$:/wd4603>) - add_compile_options($<$:/wd4627>) - add_compile_options($<$:/wd4838>) - add_compile_options($<$:/wd4456>) - add_compile_options($<$:/wd4457>) - add_compile_options($<$:/wd4458>) - add_compile_options($<$:/wd4459>) - add_compile_options($<$:/wd4091>) - add_compile_options($<$:/we4640>) - # Disable Warnings: - # 4291: Delete not defined for new, c++ exception may cause leak. - # 5105: Windows SDK headers use 'defined' operator in some macros - add_compile_options($<$:/wd4291>) - add_compile_options($<$:/wd5105>) + add_compile_options($<$:/wd4065>) # switch statement contains 'default' but no 'case' labels + add_compile_options($<$:/wd4100>) # 'identifier' : unreferenced formal parameter + add_compile_options($<$:/wd4127>) # conditional expression is constant + add_compile_options($<$:/wd4189>) # local variable is initialized but not referenced + add_compile_options($<$:/wd4200>) # nonstandard extension used : zero-sized array in struct/union + add_compile_options($<$:/wd4201>) # nonstandard extension used : nameless struct/union + add_compile_options($<$:/wd4245>) # conversion from 'type1' to 'type2', signed/unsigned mismatch + add_compile_options($<$:/wd4291>) # no matching operator delete found; memory will not be freed if initialization throws an exception + add_compile_options($<$:/wd4456>) # declaration of 'identifier' hides previous local declaration + add_compile_options($<$:/wd4457>) # declaration of 'identifier' hides function parameter + add_compile_options($<$:/wd4458>) # declaration of 'identifier' hides class member + add_compile_options($<$:/wd4838>) # conversion from 'type_1' to 'type_2' requires a narrowing conversion + add_compile_options($<$:/wd4960>) # 'function' is too big to be profiled + add_compile_options($<$:/wd4961>) # No profile data was merged into '.pgd file', profile-guided optimizations disabled + add_compile_options($<$:/wd5105>) # macro expansion producing 'defined' has undefined behavior # Treat Warnings as Errors: - # 4007: 'main' : must be __cdecl. - # 4013: 'function' undefined - assuming extern returning int. - # 4102: "'%$S' : unreferenced label". - # 4551: Function call missing argument list. - # 4700: Local used w/o being initialized. - # 4806: Unsafe operation involving type 'bool'. - add_compile_options($<$:/we4007>) - add_compile_options($<$:/we4013>) - add_compile_options($<$:/we4102>) - add_compile_options($<$:/we4551>) - add_compile_options($<$:/we4700>) - add_compile_options($<$:/we4806>) + add_compile_options($<$:/we4007>) # 'main' : must be __cdecl. + add_compile_options($<$:/we4013>) # 'function' undefined - assuming extern returning int. + add_compile_options($<$:/we4102>) # "'%$S' : unreferenced label". + add_compile_options($<$:/we4551>) # Function call missing argument list. + add_compile_options($<$:/we4700>) # Local used w/o being initialized. + add_compile_options($<$:/we4640>) # 'instance' : construction of local static object is not thread-safe + add_compile_options($<$:/we4806>) # Unsafe operation involving type 'bool'. # Set Warning Level 3: - # 4092: Sizeof returns 'unsigned long'. - # 4121: Structure is sensitive to alignment. - # 4125: Decimal digit in octal sequence. - # 4130: Logical operation on address of string constant. - # 4132: Const object should be initialized. - # 4212: Function declaration used ellipsis. - # 4530: C++ exception handler used, but unwind semantics are not enabled. Specify -GX. - # 35038: data member 'member1' will be initialized after data member 'member2'. - add_compile_options($<$:/w34092>) - add_compile_options($<$:/w34121>) - add_compile_options($<$:/w34125>) - add_compile_options($<$:/w34130>) - add_compile_options($<$:/w34132>) - add_compile_options($<$:/w34212>) - add_compile_options($<$:/w34530>) - add_compile_options($<$:/w35038>) + add_compile_options($<$:/w34092>) # Sizeof returns 'unsigned long'. + add_compile_options($<$:/w34121>) # Structure is sensitive to alignment. + add_compile_options($<$:/w34125>) # Decimal digit in octal sequence. + add_compile_options($<$:/w34130>) # Logical operation on address of string constant. + add_compile_options($<$:/w34132>) # Const object should be initialized. + add_compile_options($<$:/w34212>) # Function declaration used ellipsis. + add_compile_options($<$:/w34530>) # C++ exception handler used, but unwind semantics are not enabled. Specify -GX. + add_compile_options($<$:/w35038>) # data member 'member1' will be initialized after data member 'member2'. # Set Warning Level 4: - # 4177: Pragma data_seg s/b at global scope. - add_compile_options($<$:/w44177>) + add_compile_options($<$:/w44177>) # Pragma data_seg s/b at global scope. add_compile_options($<$:/Zi>) # enable debugging information add_compile_options($<$:/ZH:SHA_256>) # use SHA256 for generating hashes of compiler processed source files. diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp index bb49d1ce0f1c6..9b639033c727a 100644 --- a/src/coreclr/jit/codegencommon.cpp +++ b/src/coreclr/jit/codegencommon.cpp @@ -11299,7 +11299,6 @@ void CodeGen::genMultiRegStoreToLocal(GenTreeLclVar* lclNode) // genConsumeReg will return the valid register, either from the COPY // or from the original source. assert(reg != REG_NA); - regNumber varReg = REG_NA; if (isMultiRegVar) { // Each field is passed in its own register, use the field types. @@ -11409,7 +11408,6 @@ void CodeGen::genRegCopy(GenTree* treeNode) // // There should never be any circular dependencies, and we will check that here. - GenTreeCopyOrReload* copyNode = treeNode->AsCopyOrReload(); // GenTreeCopyOrReload only reports the highest index that has a valid register. // However, we need to ensure that we consume all the registers of the child node, // so we use its regCount. @@ -11535,7 +11533,6 @@ regNumber CodeGen::genRegCopy(GenTree* treeNode, unsigned multiRegIndex) if (targetReg != REG_NA) { // We shouldn't specify a no-op move. - regMaskTP targetRegMask = genRegMask(targetReg); assert(sourceReg != targetReg); var_types type; if (op1->IsMultiRegLclVar()) diff --git a/src/coreclr/jit/codegenlinear.cpp b/src/coreclr/jit/codegenlinear.cpp index 4260548d9ab14..322de733ade6d 100644 --- a/src/coreclr/jit/codegenlinear.cpp +++ b/src/coreclr/jit/codegenlinear.cpp @@ -1401,8 +1401,6 @@ regNumber CodeGen::genConsumeReg(GenTree* tree, unsigned multiRegIndex) unsigned fieldVarNum = varDsc->lvFieldLclStart + multiRegIndex; LclVarDsc* fldVarDsc = compiler->lvaGetDesc(fieldVarNum); assert(fldVarDsc->lvLRACandidate); - bool isInReg = fldVarDsc->lvIsInReg() && reg != REG_NA; - bool isInMemory = !isInReg || fldVarDsc->lvLiveInOutOfHndlr; bool isFieldDying = lcl->IsLastUse(multiRegIndex); if (fldVarDsc->GetRegNum() == REG_STK) @@ -1507,8 +1505,6 @@ regNumber CodeGen::genConsumeReg(GenTree* tree) { reg = lcl->AsLclVar()->GetRegNumByIdx(i); } - bool isInReg = fldVarDsc->lvIsInReg() && reg != REG_NA; - bool isInMemory = !isInReg || fldVarDsc->lvLiveInOutOfHndlr; bool isFieldDying = lcl->IsLastUse(i); if (fldVarDsc->GetRegNum() == REG_STK) diff --git a/src/coreclr/jit/codegenxarch.cpp b/src/coreclr/jit/codegenxarch.cpp index f1f08a68e855e..e82f6d8254bc6 100644 --- a/src/coreclr/jit/codegenxarch.cpp +++ b/src/coreclr/jit/codegenxarch.cpp @@ -4230,7 +4230,6 @@ void CodeGen::genCodeForShiftLong(GenTree* tree) void CodeGen::genCodeForShiftRMW(GenTreeStoreInd* storeInd) { GenTree* data = storeInd->Data(); - GenTree* addr = storeInd->Addr(); assert(data->OperIsShift() || data->OperIsRotate()); @@ -4265,7 +4264,6 @@ void CodeGen::genCodeForShiftRMW(GenTreeStoreInd* storeInd) // We must have the number of bits to shift stored in ECX, since we constrained this node to // sit in ECX. In case this didn't happen, LSRA expects the code generator to move it since it's a single // register destination requirement. - regNumber shiftReg = shiftBy->GetRegNum(); genCopyRegIfNeeded(shiftBy, REG_RCX); // The shiftBy operand is implicit, so call the unary version of emitInsRMW. diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp index 3570d37fc3386..311bde08e1fd9 100644 --- a/src/coreclr/jit/compiler.cpp +++ b/src/coreclr/jit/compiler.cpp @@ -2762,8 +2762,6 @@ void Compiler::compInitOptions(JitFlags* jitFlags) if (!altJitConfig || opts.altJit) { - LPCWSTR dumpIRFormat = nullptr; - // We should only enable 'verboseDump' when we are actually compiling a matching method // and not enable it when we are just considering inlining a matching method. // diff --git a/src/coreclr/jit/emit.cpp b/src/coreclr/jit/emit.cpp index ad044c9dbebc4..01894102ed767 100644 --- a/src/coreclr/jit/emit.cpp +++ b/src/coreclr/jit/emit.cpp @@ -4698,7 +4698,7 @@ unsigned emitter::getLoopSize(insGroup* igLoopHeader, unsigned maxLoopSize DEBUG } else { - instrDescAlign *alignInstrToAdj = alignInstr, *prevAlignInstr = nullptr; + instrDescAlign* alignInstrToAdj = alignInstr; for (; alignInstrToAdj != nullptr && alignInstrToAdj->idaIG == alignInstr->idaIG; alignInstrToAdj = alignInstrToAdj->idaNext) { @@ -4807,14 +4807,7 @@ void emitter::emitLoopAlignAdjustments() unsigned short estimatedPaddingNeeded = emitComp->opts.compJitAlignPaddingLimit; unsigned short alignmentBoundary = emitComp->opts.compJitAlignLoopBoundary; - if (emitComp->opts.compJitAlignLoopAdaptive) - { - // For adaptive, adjust the loop size depending on the alignment boundary - int maxBlocksAllowedForLoop = genLog2((unsigned)alignmentBoundary) - 1; - } - unsigned alignBytesRemoved = 0; - unsigned loopSize = 0; unsigned loopIGOffset = 0; instrDescAlign* alignInstr = emitAlignList; @@ -6555,7 +6548,6 @@ void emitter::emitOutputDataSec(dataSecDsc* sec, BYTE* dst) { JITDUMP(" section %u, size %u, block relative addr\n", secNum++, dscSize); - unsigned elemSize = 4; size_t numElems = dscSize / 4; unsigned* uDst = (unsigned*)dst; insGroup* labFirst = (insGroup*)emitCodeGetCookie(emitComp->fgFirstBB); @@ -7010,10 +7002,11 @@ void emitter::emitRecordGCcall(BYTE* codePos, unsigned char callInstrSize) assert(!emitFullGCinfo); unsigned offs = emitCurCodeOffs(codePos); - unsigned regs = (emitThisGCrefRegs | emitThisByrefRegs) & ~RBM_INTRET; callDsc* call; #ifdef JIT32_GCENCODER + unsigned regs = (emitThisGCrefRegs | emitThisByrefRegs) & ~RBM_INTRET; + // The JIT32 GCInfo encoder allows us to (as the comment previously here said): // "Bail if this is a totally boring call", but the GCInfoEncoder/Decoder interface // requires a definition for every call site, so we skip these "early outs" when we're diff --git a/src/coreclr/jit/fgdiagnostic.cpp b/src/coreclr/jit/fgdiagnostic.cpp index 07720a8b18713..8f3a80c6dd063 100644 --- a/src/coreclr/jit/fgdiagnostic.cpp +++ b/src/coreclr/jit/fgdiagnostic.cpp @@ -1952,8 +1952,6 @@ void Compiler::fgDebugCheckBBlist(bool checkBBNum /* = false */, bool checkBBRef return; } - DWORD startTickCount = GetTickCount(); - #if defined(FEATURE_EH_FUNCLETS) bool reachedFirstFunclet = false; if (fgFuncletsCreated) diff --git a/src/coreclr/jit/fgehopt.cpp b/src/coreclr/jit/fgehopt.cpp index 7de6120fd9b4a..e462dc798e3c4 100644 --- a/src/coreclr/jit/fgehopt.cpp +++ b/src/coreclr/jit/fgehopt.cpp @@ -1323,7 +1323,6 @@ void Compiler::fgDebugCheckTryFinallyExits() { unsigned XTnum = 0; EHblkDsc* HBtab = compHndBBtab; - unsigned cloneCount = 0; bool allTryExitsValid = true; for (; XTnum < compHndBBtabCount; XTnum++, HBtab++) { diff --git a/src/coreclr/jit/fgflow.cpp b/src/coreclr/jit/fgflow.cpp index 8c5cd174ca153..5a1ba9d687ccc 100644 --- a/src/coreclr/jit/fgflow.cpp +++ b/src/coreclr/jit/fgflow.cpp @@ -704,8 +704,6 @@ void Compiler::fgRemoveCheapPred(BasicBlock* block, BasicBlock* blockPred) assert(!fgComputePredsDone); assert(fgCheapPredsValid); - flowList* oldEdge = nullptr; - assert(block != nullptr); assert(blockPred != nullptr); assert(block->bbCheapPreds != nullptr); diff --git a/src/coreclr/jit/fginline.cpp b/src/coreclr/jit/fginline.cpp index a51ca24773da7..7d36115e69c59 100644 --- a/src/coreclr/jit/fginline.cpp +++ b/src/coreclr/jit/fginline.cpp @@ -1847,8 +1847,6 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo) } else { - CORINFO_CLASS_HANDLE structType = - lclVarInfo[lclNum + inlineInfo->argCnt].lclVerTypeInfo.GetClassHandle(); tree = gtNewBlkOpNode(gtNewLclvNode(tmpNum, lclTyp), // Dest gtNewIconNode(0), // Value false, // isVolatile diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp index cc6ff733f4bba..8f9c74818cc1b 100644 --- a/src/coreclr/jit/fgopt.cpp +++ b/src/coreclr/jit/fgopt.cpp @@ -2687,8 +2687,7 @@ bool Compiler::fgOptimizeSwitchBranches(BasicBlock* block) // if (block->NumSucc(this) == 1) { - // Use BBJ_ALWAYS for a switch with only a default clause, or with only one unique successor. - BasicBlock* uniqueSucc = jmpTab[0]; +// Use BBJ_ALWAYS for a switch with only a default clause, or with only one unique successor. #ifdef DEBUG if (verbose) diff --git a/src/coreclr/jit/gcencode.cpp b/src/coreclr/jit/gcencode.cpp index 9ce6456a391cc..c20f7d6bd7416 100644 --- a/src/coreclr/jit/gcencode.cpp +++ b/src/coreclr/jit/gcencode.cpp @@ -4094,10 +4094,6 @@ void GCInfo::gcMakeRegPtrTable( ************************************************************************** */ - unsigned count = 0; - - int lastoffset = 0; - /* Count&Write untracked locals and non-enregistered args */ unsigned varNum; @@ -4324,8 +4320,6 @@ void GCInfo::gcMakeRegPtrTable( for (regPtrDsc* genRegPtrTemp = gcRegPtrList; genRegPtrTemp != nullptr; genRegPtrTemp = genRegPtrTemp->rpdNext) { - int nextOffset = genRegPtrTemp->rpdOffs; - if (genRegPtrTemp->rpdArg) { if (genRegPtrTemp->rpdArgTypeGet() == rpdARG_KILL) diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 98cc8e0d05586..f1b78eb094e45 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -3521,8 +3521,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) case GT_CNS_DBL: { - var_types targetType = tree->TypeGet(); - level = 0; + level = 0; #if defined(TARGET_XARCH) /* We use fldz and fld1 to load 0.0 and 1.0, but all other */ /* floating point constants are loaded using an indirection */ @@ -3538,6 +3537,7 @@ unsigned Compiler::gtSetEvalOrder(GenTree* tree) costSz = 4; } #elif defined(TARGET_ARM) + var_types targetType = tree->TypeGet(); if (targetType == TYP_FLOAT) { costEx = 1 + 2; @@ -10107,9 +10107,7 @@ void Compiler::gtDispCommonEndLine(GenTree* tree) void Compiler::gtDispNode(GenTree* tree, IndentStack* indentStack, __in __in_z __in_opt const char* msg, bool isLIR) { - bool printPointer = true; // always true.. - bool printFlags = true; // always true.. - bool printCost = true; // always true.. + bool printFlags = true; // always true.. int msgLength = 25; @@ -16969,8 +16967,6 @@ bool GenTree::isContained() const // They can only produce a result if the child is a SIMD equality comparison. else if (OperKind() & GTK_RELOP) { - // We have to cast away const-ness since AsOp() method is non-const. - const GenTree* childNode = AsOp()->gtGetOp1(); assert(isMarkedContained == false); } @@ -17262,8 +17258,7 @@ bool GenTree::IsFieldAddr(Compiler* comp, GenTree** pObj, GenTree** pStatic, Fie // // The CSE could be a pointer to a boxed struct // - GenTreeLclVarCommon* lclVar = AsLclVarCommon(); - ValueNum vn = gtVNPair.GetLiberal(); + ValueNum vn = gtVNPair.GetLiberal(); if (vn != ValueNumStore::NoVN) { // Is the ValueNum a MapSelect involving a SharedStatic helper? diff --git a/src/coreclr/jit/hwintrinsic.cpp b/src/coreclr/jit/hwintrinsic.cpp index 2f589a4db9c83..dee63b2c99d69 100644 --- a/src/coreclr/jit/hwintrinsic.cpp +++ b/src/coreclr/jit/hwintrinsic.cpp @@ -416,8 +416,7 @@ GenTree* HWIntrinsicInfo::lookupLastOp(const GenTreeHWIntrinsic* node) { assert(node != nullptr); - NamedIntrinsic id = node->gtHWIntrinsicId; - GenTree* op1 = node->gtGetOp1(); + GenTree* op1 = node->gtGetOp1(); if (op1 == nullptr) { @@ -778,11 +777,10 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic, CORINFO_SIG_INFO* sig, bool mustExpand) { - CORINFO_InstructionSet isa = HWIntrinsicInfo::lookupIsa(intrinsic); - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsic); - int numArgs = sig->numArgs; - var_types retType = JITtype2varType(sig->retType); - var_types baseType = TYP_UNKNOWN; + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsic); + int numArgs = sig->numArgs; + var_types retType = JITtype2varType(sig->retType); + var_types baseType = TYP_UNKNOWN; if ((retType == TYP_STRUCT) && featureSIMD) { diff --git a/src/coreclr/jit/hwintrinsiccodegenxarch.cpp b/src/coreclr/jit/hwintrinsiccodegenxarch.cpp index 49858f9aa2d0b..e5ae7fa13b445 100644 --- a/src/coreclr/jit/hwintrinsiccodegenxarch.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenxarch.cpp @@ -89,11 +89,10 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) if (genIsTableDrivenHWIntrinsic(intrinsicId, category)) { - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - regNumber targetReg = node->GetRegNum(); - var_types targetType = node->TypeGet(); - var_types baseType = node->gtSIMDBaseType; + GenTree* op1 = node->gtGetOp1(); + GenTree* op2 = node->gtGetOp2(); + regNumber targetReg = node->GetRegNum(); + var_types baseType = node->gtSIMDBaseType; regNumber op1Reg = REG_NA; regNumber op2Reg = REG_NA; @@ -549,11 +548,9 @@ void CodeGen::genHWIntrinsic_R_RM( // void CodeGen::genHWIntrinsic_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, int8_t ival) { - var_types targetType = node->TypeGet(); - regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - emitAttr simdSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->gtSIMDSize)); - emitter* emit = GetEmitter(); + regNumber targetReg = node->GetRegNum(); + GenTree* op1 = node->gtGetOp1(); + emitAttr simdSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->gtSIMDSize)); // TODO-XArch-CQ: Commutative operations can have op1 be contained // TODO-XArch-CQ: Non-VEX encoded instructions can have both ops contained @@ -630,12 +627,11 @@ void CodeGen::genHWIntrinsic_R_R_RM( // void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, int8_t ival) { - var_types targetType = node->TypeGet(); - regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - emitAttr simdSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->gtSIMDSize)); - emitter* emit = GetEmitter(); + regNumber targetReg = node->GetRegNum(); + GenTree* op1 = node->gtGetOp1(); + GenTree* op2 = node->gtGetOp2(); + emitAttr simdSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->gtSIMDSize)); + emitter* emit = GetEmitter(); // TODO-XArch-CQ: Commutative operations can have op1 be contained // TODO-XArch-CQ: Non-VEX encoded instructions can have both ops contained @@ -795,13 +791,12 @@ void CodeGen::genHWIntrinsic_R_R_RM_I(GenTreeHWIntrinsic* node, instruction ins, // void CodeGen::genHWIntrinsic_R_R_RM_R(GenTreeHWIntrinsic* node, instruction ins) { - var_types targetType = node->TypeGet(); - regNumber targetReg = node->GetRegNum(); - GenTree* op1 = node->gtGetOp1(); - GenTree* op2 = node->gtGetOp2(); - GenTree* op3 = nullptr; - emitAttr simdSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->gtSIMDSize)); - emitter* emit = GetEmitter(); + regNumber targetReg = node->GetRegNum(); + GenTree* op1 = node->gtGetOp1(); + GenTree* op2 = node->gtGetOp2(); + GenTree* op3 = nullptr; + emitAttr simdSize = emitActualTypeSize(Compiler::getSIMDTypeForSize(node->gtSIMDSize)); + emitter* emit = GetEmitter(); assert(op1->OperIsList()); assert(op2 == nullptr); @@ -1095,7 +1090,6 @@ void CodeGen::genHWIntrinsicJumpTableFallback(NamedIntrinsic intrinsi BasicBlock* jmpTable[256]; unsigned jmpTableBase = emit->emitBBTableDataGenBeg(maxByte, true); - unsigned jmpTableOffs = 0; // Emit the jump table for (unsigned i = 0; i < maxByte; i++) @@ -1144,7 +1138,6 @@ void CodeGen::genBaseIntrinsic(GenTreeHWIntrinsic* node) { NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; regNumber targetReg = node->GetRegNum(); - var_types targetType = node->TypeGet(); var_types baseType = node->gtSIMDBaseType; assert(compiler->compIsaSupportedDebugOnly(InstructionSet_SSE)); @@ -1333,16 +1326,11 @@ void CodeGen::genSSEIntrinsic(GenTreeHWIntrinsic* node) NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; GenTree* op1 = node->gtGetOp1(); GenTree* op2 = node->gtGetOp2(); - GenTree* op3 = nullptr; - GenTree* op4 = nullptr; regNumber targetReg = node->GetRegNum(); var_types targetType = node->TypeGet(); var_types baseType = node->gtSIMDBaseType; regNumber op1Reg = REG_NA; - regNumber op2Reg = REG_NA; - regNumber op3Reg = REG_NA; - regNumber op4Reg = REG_NA; emitter* emit = GetEmitter(); genConsumeHWIntrinsicOperands(node); @@ -1418,7 +1406,6 @@ void CodeGen::genSSE2Intrinsic(GenTreeHWIntrinsic* node) var_types targetType = node->TypeGet(); var_types baseType = node->gtSIMDBaseType; regNumber op1Reg = REG_NA; - regNumber op2Reg = REG_NA; emitter* emit = GetEmitter(); genConsumeHWIntrinsicOperands(node); @@ -1520,17 +1507,10 @@ void CodeGen::genSSE41Intrinsic(GenTreeHWIntrinsic* node) NamedIntrinsic intrinsicId = node->gtHWIntrinsicId; GenTree* op1 = node->gtGetOp1(); GenTree* op2 = node->gtGetOp2(); - GenTree* op3 = nullptr; - GenTree* op4 = nullptr; regNumber targetReg = node->GetRegNum(); - var_types targetType = node->TypeGet(); var_types baseType = node->gtSIMDBaseType; - regNumber op1Reg = REG_NA; - regNumber op2Reg = REG_NA; - regNumber op3Reg = REG_NA; - regNumber op4Reg = REG_NA; - emitter* emit = GetEmitter(); + emitter* emit = GetEmitter(); genConsumeHWIntrinsicOperands(node); diff --git a/src/coreclr/jit/hwintrinsicxarch.cpp b/src/coreclr/jit/hwintrinsicxarch.cpp index f6558fbb96708..02e0e17548a76 100644 --- a/src/coreclr/jit/hwintrinsicxarch.cpp +++ b/src/coreclr/jit/hwintrinsicxarch.cpp @@ -1459,17 +1459,12 @@ GenTree* Compiler::impSSE2Intrinsic(NamedIntrinsic intrinsic, CORINFO_METHOD_HAN GenTree* retNode = nullptr; GenTree* op1 = nullptr; GenTree* op2 = nullptr; - int ival = -1; int simdSize = HWIntrinsicInfo::lookupSimdSize(this, intrinsic, sig); var_types baseType = getBaseTypeOfSIMDType(sig->retTypeSigClass); - var_types retType = TYP_UNKNOWN; // The fencing intrinsics don't take any operands and simdSize is 0 assert((simdSize == 16) || (simdSize == 0)); - CORINFO_ARG_LIST_HANDLE argList = sig->args; - var_types argType = TYP_UNKNOWN; - switch (intrinsic) { case NI_SSE2_CompareScalarGreaterThan: diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 390597df7ebc3..9f7def4123885 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -6889,8 +6889,7 @@ void Compiler::impImportNewObjArray(CORINFO_RESOLVED_TOKEN* pResolvedToken, CORI // pass number of arguments to the helper args = gtPrependNewCallArg(gtNewIconNode(pCallInfo->sig.numArgs), args); - unsigned argFlags = 0; - args = impPopCallArgs(pCallInfo->sig.numArgs, &pCallInfo->sig, args); + args = impPopCallArgs(pCallInfo->sig.numArgs, &pCallInfo->sig, args); node = gtNewHelperCallNode(CORINFO_HELP_NEW_MDARR, TYP_REF, args); @@ -6957,8 +6956,7 @@ GenTree* Compiler::impTransformThis(GenTree* thisPtr, obj = gtNewObjNode(pConstrainedResolvedToken->hClass, obj); obj->gtFlags |= GTF_EXCEPT; - CorInfoType jitTyp = info.compCompHnd->asCorInfoType(pConstrainedResolvedToken->hClass); - var_types objType = JITtype2varType(jitTyp); + CorInfoType jitTyp = info.compCompHnd->asCorInfoType(pConstrainedResolvedToken->hClass); if (impIsPrimitive(jitTyp)) { if (obj->OperIsBlk()) @@ -7956,7 +7954,6 @@ var_types Compiler::impImportCall(OPCODE opcode, CORINFO_CLASS_HANDLE clsHnd = nullptr; unsigned clsFlags = 0; unsigned mflags = 0; - unsigned argFlags = 0; GenTree* call = nullptr; GenTreeCall::Use* args = nullptr; CORINFO_THIS_TRANSFORM constraintCallThisTransform = CORINFO_NO_THIS_TRANSFORM; @@ -9410,7 +9407,6 @@ var_types Compiler::impImportJitTestLabelMark(int numArgs) // a GT_IND of a static field address, which should be the sum of a (hoistable) helper call and possibly some // offset within the the static field block whose address is returned by the helper call. // The annotation is saying that this address calculation, but not the entire access, should be hoisted. - GenTree* helperCall = nullptr; assert(node->OperGet() == GT_IND); tlAndN.m_num -= 100; GetNodeTestData()->Set(node->AsOp()->gtOp1, tlAndN); @@ -10866,7 +10862,6 @@ GenTree* Compiler::impOptimizeCastClassOrIsInst(GenTree* op1, CORINFO_RESOLVED_T bool isExact = false; bool isNonNull = false; CORINFO_CLASS_HANDLE fromClass = gtGetClassHandle(op1, &isExact, &isNonNull); - GenTree* optResult = nullptr; if (fromClass != nullptr) { @@ -11267,7 +11262,9 @@ void Compiler::impImportBlockCode(BasicBlock* block) while (codeAddr < codeEndp) { - bool usingReadyToRunHelper = false; +#ifdef FEATURE_READYTORUN_COMPILER + bool usingReadyToRunHelper = false; +#endif CORINFO_RESOLVED_TOKEN resolvedToken; CORINFO_RESOLVED_TOKEN constrainedResolvedToken; CORINFO_CALL_INFO callInfo; @@ -20911,11 +20908,10 @@ void Compiler::impDevirtualizeCall(GenTreeCall* call, } // See what we know about the type of 'this' in the call. - GenTree* thisObj = call->gtCallThisArg->GetNode()->gtEffectiveVal(false); - GenTree* actualThisObj = nullptr; - bool isExact = false; - bool objIsNonNull = false; - CORINFO_CLASS_HANDLE objClass = gtGetClassHandle(thisObj, &isExact, &objIsNonNull); + GenTree* thisObj = call->gtCallThisArg->GetNode()->gtEffectiveVal(false); + bool isExact = false; + bool objIsNonNull = false; + CORINFO_CLASS_HANDLE objClass = gtGetClassHandle(thisObj, &isExact, &objIsNonNull); // Bail if we know nothing. if (objClass == nullptr) diff --git a/src/coreclr/jit/indirectcalltransformer.cpp b/src/coreclr/jit/indirectcalltransformer.cpp index a26db2c4531c7..362198a71364d 100644 --- a/src/coreclr/jit/indirectcalltransformer.cpp +++ b/src/coreclr/jit/indirectcalltransformer.cpp @@ -436,7 +436,6 @@ class IndirectCallTransformer Statement* CreateFatCallStmt(GenTree* actualCallAddress, GenTree* hiddenArgument) { Statement* fatStmt = compiler->gtCloneStmt(stmt); - GenTree* fatTree = fatStmt->GetRootNode(); GenTreeCall* fatCall = GetCall(fatStmt); fatCall->gtCallAddr = actualCallAddress; AddHiddenArgument(fatCall, hiddenArgument); @@ -867,7 +866,6 @@ class IndirectCallTransformer { GenTree* tree = callStmt->GetRootNode(); assert(tree->OperIs(GT_ASG)); - GenTreeOp* asg = tree->AsOp(); GenTreeCall* call = tree->gtGetOp2()->AsCall(); return call; } diff --git a/src/coreclr/jit/inline.cpp b/src/coreclr/jit/inline.cpp index a2eee7dce1afd..e3d90f3ebe3c4 100644 --- a/src/coreclr/jit/inline.cpp +++ b/src/coreclr/jit/inline.cpp @@ -1456,8 +1456,7 @@ void InlineStrategy::DumpDataContents(FILE* file) DumpDataEnsurePolicyIsSet(); // Cache references to compiler substructures. - const Compiler::Info& info = m_Compiler->info; - const Compiler::Options& opts = m_Compiler->opts; + const Compiler::Info& info = m_Compiler->info; // We'd really like the method identifier to be unique and // durable across crossgen invocations. Not clear how to diff --git a/src/coreclr/jit/jit.h b/src/coreclr/jit/jit.h index 562eaccbba073..7e6eb27a64c09 100644 --- a/src/coreclr/jit/jit.h +++ b/src/coreclr/jit/jit.h @@ -25,25 +25,6 @@ // break. Replacing those instances with ZERO avoids this change #define ZERO 0 -#ifdef _MSC_VER -// These don't seem useful, so turning them off is no big deal -#pragma warning(disable : 4065) // "switch statement contains 'default' but no 'case' labels" (happens due to #ifdefs) -#pragma warning(disable : 4510) // can't generate default constructor -#pragma warning(disable : 4511) // can't generate copy constructor -#pragma warning(disable : 4512) // can't generate assignment constructor -#pragma warning(disable : 4610) // user defined constructor required -#pragma warning(disable : 4211) // nonstandard extension used (char name[0] in structs) -#pragma warning(disable : 4127) // conditional expression constant -#pragma warning(disable : 4201) // "nonstandard extension used : nameless struct/union" - -// Depending on the code base, you may want to not disable these -#pragma warning(disable : 4245) // assigning signed / unsigned -#pragma warning(disable : 4146) // unary minus applied to unsigned - -#pragma warning(disable : 4100) // unreferenced formal parameter -#pragma warning(disable : 4291) // new operator without delete (only in emitX86.cpp) -#endif - #ifdef _MSC_VER #define CHECK_STRUCT_PADDING 0 // Set this to '1' to enable warning C4820 "'bytes' bytes padding added after // construct 'member_name'" on interesting structs/classes diff --git a/src/coreclr/jit/layout.cpp b/src/coreclr/jit/layout.cpp index 6318b56e195a4..3b07a5bada350 100644 --- a/src/coreclr/jit/layout.cpp +++ b/src/coreclr/jit/layout.cpp @@ -1,3 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + #include "jitpch.h" #include "layout.h" #include "compiler.h" diff --git a/src/coreclr/jit/layout.h b/src/coreclr/jit/layout.h index 6a74949cfd214..cef2fe6ded3ab 100644 --- a/src/coreclr/jit/layout.h +++ b/src/coreclr/jit/layout.h @@ -1,3 +1,6 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + #ifndef LAYOUT_H #define LAYOUT_H diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index 65170c586f158..3eaaac1408bc4 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -3555,7 +3555,6 @@ void Lowering::LowerStoreSingleRegCallStruct(GenTreeBlk* store) const ClassLayout* layout = store->GetLayout(); const var_types regType = layout->GetRegisterType(); - unsigned storeSize = store->GetLayout()->GetSize(); if (regType != TYP_UNDEF) { store->ChangeType(regType); @@ -5392,10 +5391,9 @@ GenTree* Lowering::LowerConstIntDivOrMod(GenTree* node) // For -3 we need: // mulhi -= dividend ; requires sub adjust // div = signbit(mulhi) + sar(mulhi, 1) ; requires shift adjust - bool requiresAddSubAdjust = signum(divisorValue) != signum(magic); - bool requiresShiftAdjust = shift != 0; - bool requiresDividendMultiuse = requiresAddSubAdjust || !isDiv; - BasicBlock::weight_t curBBWeight = comp->compCurBB->getBBWeight(comp); + bool requiresAddSubAdjust = signum(divisorValue) != signum(magic); + bool requiresShiftAdjust = shift != 0; + bool requiresDividendMultiuse = requiresAddSubAdjust || !isDiv; if (requiresDividendMultiuse) { diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp index 98aa897960009..dfa6fe68ff421 100644 --- a/src/coreclr/jit/lowerxarch.cpp +++ b/src/coreclr/jit/lowerxarch.cpp @@ -5158,7 +5158,6 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node) HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsicId); int numArgs = HWIntrinsicInfo::lookupNumArgs(node); var_types baseType = node->gtSIMDBaseType; - unsigned simdSize = node->gtSIMDSize; GenTree* op1 = node->gtGetOp1(); GenTree* op2 = node->gtGetOp2(); diff --git a/src/coreclr/jit/lsra.cpp b/src/coreclr/jit/lsra.cpp index bbcc44a281404..fabb3e30328bd 100644 --- a/src/coreclr/jit/lsra.cpp +++ b/src/coreclr/jit/lsra.cpp @@ -816,9 +816,8 @@ void LinearScan::setBlockSequence() assert(blockSequenceWorkList == nullptr); - bool addedInternalBlocks = false; - verifiedAllBBs = false; - hasCriticalEdges = false; + verifiedAllBBs = false; + hasCriticalEdges = false; BasicBlock* nextBlock; // We use a bbNum of 0 for entry RefPositions. // The other information in blockInfo[0] will never be used. @@ -2943,17 +2942,11 @@ regNumber LinearScan::allocateReg(Interval* currentInterval, RefPosition* refPos REG_NUM = 0x0001, // It has a lower register number. }; - LsraLocation bestLocation = MinLocation; - LsraLocation farRefLocation = MinLocation; - // These are used in the post-selection updates, and must be set for any selection. regMaskTP freeCandidates = RBM_NONE; regMaskTP matchingConstants = RBM_NONE; regMaskTP unassignedSet = RBM_NONE; - // These must be set prior to their use in the associated heuristics. - unsigned int thisSpillWeight = 0; - // We'll set this to short-circuit remaining heuristics when we have a single candidate. bool found = false; @@ -3295,8 +3288,6 @@ regNumber LinearScan::allocateReg(Interval* currentInterval, RefPosition* refPos float thisSpillWeight = getWeight(refPosition); // The spill weight for the best candidate we've found so far. float bestSpillWeight = FloatingPointUtils::infinite_float(); - // True if we found registers with lower spill weight than this refPosition. - bool foundLowerSpillWeight = false; for (regMaskTP spillCandidates = selector.candidates; spillCandidates != RBM_NONE;) { @@ -3503,9 +3494,8 @@ regNumber LinearScan::allocateReg(Interval* currentInterval, RefPosition* refPos // the current interval to a previous assignment, we don't remember the previous interval. // Note that we need to compute this condition before calling unassignPhysReg, which wil reset // assignedInterval->physReg. - regMaskTP freePrefCandidates = (selector.candidates & preferences & freeCandidates); - bool wasThisAssigned = ((prevRegBit & preferences) == foundRegBit); - bool wasAssigned = (((foundRegBit & unassignedSet) != RBM_NONE) && !wasThisAssigned && + bool wasThisAssigned = ((prevRegBit & preferences) == foundRegBit); + bool wasAssigned = (((foundRegBit & unassignedSet) != RBM_NONE) && !wasThisAssigned && (assignedInterval != nullptr) && (assignedInterval->physReg == foundReg)); unassignPhysReg(availablePhysRegRecord ARM_ARG(currentInterval->registerType)); if ((matchingConstants & foundRegBit) != RBM_NONE) @@ -3741,11 +3731,6 @@ regNumber LinearScan::assignCopyReg(RefPosition* refPosition) assert(currentInterval != nullptr); assert(currentInterval->isActive); - bool foundFreeReg = false; - RegRecord* bestPhysReg = nullptr; - LsraLocation bestLocation = MinLocation; - regMaskTP candidates = refPosition->registerAssignment; - // Save the relatedInterval, if any, so that it doesn't get modified during allocation. Interval* savedRelatedInterval = currentInterval->relatedInterval; currentInterval->relatedInterval = nullptr; @@ -4217,8 +4202,8 @@ void LinearScan::unassignPhysReg(RegRecord* regRec, RefPosition* spillRefPositio return; } - regNumber victimAssignedReg = assignedInterval->physReg; - assignedInterval->physReg = REG_NA; + // regNumber victimAssignedReg = assignedInterval->physReg; + assignedInterval->physReg = REG_NA; bool spill = assignedInterval->isActive && nextRefPosition != nullptr; if (spill) @@ -4706,10 +4691,9 @@ void LinearScan::processBlockStartLocations(BasicBlock* currentBlock) return; } - unsigned predBBNum = blockInfo[currentBlock->bbNum].predBBNum; - VarToRegMap predVarToRegMap = getOutVarToRegMap(predBBNum); - VarToRegMap inVarToRegMap = getInVarToRegMap(currentBlock->bbNum); - bool hasCriticalInEdge = blockInfo[currentBlock->bbNum].hasCriticalInEdge; + unsigned predBBNum = blockInfo[currentBlock->bbNum].predBBNum; + VarToRegMap predVarToRegMap = getOutVarToRegMap(predBBNum); + VarToRegMap inVarToRegMap = getInVarToRegMap(currentBlock->bbNum); // If this block enters an exception region, all incoming vars are on the stack. if (predBBNum == 0) @@ -5033,7 +5017,6 @@ void LinearScan::processBlockEndLocations(BasicBlock* currentBlock) VarSetOps::Assign(compiler, currentLiveVars, registerCandidateVars); } #endif // DEBUG - regMaskTP liveRegs = RBM_NONE; VarSetOps::Iter iter(compiler, currentLiveVars); unsigned varIndex = 0; while (iter.NextElem(&varIndex)) @@ -5180,7 +5163,7 @@ void LinearScan::freeRegisters(regMaskTP regsToFree) regsToFree &= ~(nextRegBit << 1); } #endif - freeRegister(getRegisterRecord(nextReg)); + freeRegister(regRecord); } } @@ -5252,7 +5235,6 @@ void LinearScan::allocateRegisters() } #ifdef DEBUG - regNumber lastAllocatedReg = REG_NA; if (VERBOSE) { dumpRefPositions("BEFORE ALLOCATION"); @@ -5331,7 +5313,6 @@ void LinearScan::allocateRegisters() Interval* currentInterval = nullptr; Referenceable* currentReferent = nullptr; - bool isInternalRef = false; RefType refType = currentRefPosition->refType; currentReferent = currentRefPosition->referent; @@ -5939,9 +5920,8 @@ void LinearScan::allocateRegisters() regNumber copyReg = assignCopyReg(currentRefPosition); assert(copyReg != REG_NA); INDEBUG(dumpLsraAllocationEvent(LSRA_EVENT_COPY_REG, currentInterval, copyReg)); - lastAllocatedRefPosition = currentRefPosition; - bool unassign = false; - RefPosition* nextRefPosition = currentRefPosition->nextRefPosition; + lastAllocatedRefPosition = currentRefPosition; + bool unassign = false; if (currentInterval->isWriteThru) { if (currentRefPosition->refType == RefTypeDef) @@ -6126,8 +6106,7 @@ void LinearScan::allocateRegisters() // is not used, etc. // If this is an UpperVector we'll neither free it nor preference it // (it will be freed when it is used). - bool stillInReg = true; - bool unassign = false; + bool unassign = false; if (!currentInterval->IsUpperVector()) { if (currentInterval->isWriteThru) @@ -7349,9 +7328,6 @@ void LinearScan::resolveRegisters() (refPosIterator->refType != RefTypeParamDef && refPosIterator->refType != RefTypeZeroInit)); } - BasicBlock* insertionBlock = compiler->fgFirstBB; - GenTree* insertionPoint = LIR::AsRange(insertionBlock).FirstNonPhiNode(); - // write back assignments for (block = startBlockSequence(); block != nullptr; block = moveToNextBlock()) { @@ -7718,7 +7694,6 @@ void LinearScan::resolveRegisters() regNumber initialReg = (initialRegMask == RBM_NONE || interval->firstRefPosition->spillAfter) ? REG_STK : genRegNumFromMask(initialRegMask); - regNumber sourceReg = (varDsc->lvIsRegArg) ? varDsc->GetArgReg() : REG_STK; #ifdef TARGET_ARM if (varTypeIsMultiReg(varDsc)) @@ -8259,16 +8234,12 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block) return; } VARSET_TP sameResolutionSet(VarSetOps::MakeEmpty(compiler)); - VARSET_TP sameLivePathsSet(VarSetOps::MakeEmpty(compiler)); - VARSET_TP singleTargetSet(VarSetOps::MakeEmpty(compiler)); VARSET_TP diffResolutionSet(VarSetOps::MakeEmpty(compiler)); // Get the outVarToRegMap for this block VarToRegMap outVarToRegMap = getOutVarToRegMap(block->bbNum); unsigned succCount = block->NumSucc(compiler); assert(succCount > 1); - VarToRegMap firstSuccInVarToRegMap = nullptr; - BasicBlock* firstSucc = nullptr; // First, determine the live regs at the end of this block so that we know what regs are // available to copy into. @@ -8370,9 +8341,6 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block) while (outResolutionSetIter.NextElem(&outResolutionSetVarIndex)) { regNumber fromReg = getVarReg(outVarToRegMap, outResolutionSetVarIndex); - bool isMatch = true; - bool isSame = false; - bool maybeSingleTarget = false; bool maybeSameLivePaths = false; bool liveOnlyAtSplitEdge = true; regNumber sameToReg = REG_NA; @@ -8499,7 +8467,6 @@ void LinearScan::handleOutgoingCriticalEdges(BasicBlock* block) // Now collect the resolution set for just this edge, if any. // Check only the vars in diffResolutionSet that are live-in to this successor. - bool needsResolution = false; VarToRegMap succInVarToRegMap = getInVarToRegMap(succBlock->bbNum); VARSET_TP edgeResolutionSet(VarSetOps::Intersection(compiler, diffResolutionSet, succBlock->bbLiveIn)); VarSetOps::Iter iter(compiler, edgeResolutionSet); @@ -8840,7 +8807,9 @@ void LinearScan::resolveEdge(BasicBlock* fromBlock, (resolveType == ResolveSharedCritical) ? REG_NA : getTempRegForResolution(fromBlock, toBlock, TYP_INT); #endif // !TARGET_XARCH regNumber tempRegFlt = REG_NA; - regNumber tempRegDbl = REG_NA; // Used only for ARM +#ifdef TARGET_ARM + regNumber tempRegDbl = REG_NA; +#endif if ((compiler->compFloatingPointUsed) && (resolveType != ResolveSharedCritical)) { #ifdef TARGET_ARM @@ -9985,11 +9954,8 @@ void LinearScan::TupleStyleDump(LsraTupleDumpMode mode) { GenTree* tree = node; - genTreeOps oper = tree->OperGet(); - int produce = tree->IsValue() ? ComputeOperandDstCount(tree) : 0; - int consume = ComputeAvailableSrcCount(tree); - regMaskTP killMask = RBM_NONE; - regMaskTP fixedMask = RBM_NONE; + int produce = tree->IsValue() ? ComputeOperandDstCount(tree) : 0; + int consume = ComputeAvailableSrcCount(tree); lsraDispNode(tree, mode, produce != 0 && mode != LSRA_DUMP_REFPOS); @@ -10402,8 +10368,7 @@ void LinearScan::dumpRegRecordHeader() regTableIndent = shortRefPositionDumpWidth + allocationInfoWidth; // BBnn printed left-justified in the NAME Typeld and allocationInfo space. - int bbDumpWidth = regColumnWidth + 1 + refTypeInfoWidth + allocationInfoWidth; - int bbNumWidth = (int)log10((double)compiler->fgBBNumMax) + 1; + int bbNumWidth = (int)log10((double)compiler->fgBBNumMax) + 1; // In the unlikely event that BB numbers overflow the space, we'll simply omit the predBB int predBBNumDumpSpace = regTableIndent - locationAndRPNumWidth - bbNumWidth - 9; // 'BB' + ' PredBB' if (predBBNumDumpSpace < bbNumWidth) @@ -10615,7 +10580,6 @@ void LinearScan::dumpNewBlock(BasicBlock* currentBlock, LsraLocation location) // void LinearScan::dumpRefPositionShort(RefPosition* refPosition, BasicBlock* currentBlock) { - BasicBlock* block = currentBlock; static RefPosition* lastPrintedRefPosition = nullptr; if (refPosition == lastPrintedRefPosition) { diff --git a/src/coreclr/jit/lsrabuild.cpp b/src/coreclr/jit/lsrabuild.cpp index 32441ad422aa3..61bb8ca4420e7 100644 --- a/src/coreclr/jit/lsrabuild.cpp +++ b/src/coreclr/jit/lsrabuild.cpp @@ -286,9 +286,8 @@ void LinearScan::resolveConflictingDefAndUse(Interval* interval, RefPosition* de } if (useRefPosition->isFixedRegRef && !useRegConflict) { - useReg = useRefPosition->assignedReg(); - useRegRecord = getRegisterRecord(useReg); - RefPosition* currFixedRegRefPosition = useRegRecord->recentRefPosition; + useReg = useRefPosition->assignedReg(); + useRegRecord = getRegisterRecord(useReg); // We know that useRefPosition is a fixed use, so the nextRefPosition must not be null. RefPosition* nextFixedRegRefPosition = useRegRecord->getNextRefPosition(); @@ -3802,7 +3801,6 @@ void LinearScan::HandleFloatVarArgs(GenTreeCall* call, GenTree* argNode, bool* c // int LinearScan::BuildGCWriteBarrier(GenTree* tree) { - GenTree* dst = tree; GenTree* addr = tree->gtGetOp1(); GenTree* src = tree->gtGetOp2(); @@ -3810,7 +3808,6 @@ int LinearScan::BuildGCWriteBarrier(GenTree* tree) // is an indir through an lea, we need to actually instantiate the // lea in a register assert(!addr->isContained() && !src->isContained()); - int srcCount = 2; regMaskTP addrCandidates = RBM_ARG_0; regMaskTP srcCandidates = RBM_ARG_1; diff --git a/src/coreclr/jit/lsraxarch.cpp b/src/coreclr/jit/lsraxarch.cpp index 3872e794aa884..910b121ce05ee 100644 --- a/src/coreclr/jit/lsraxarch.cpp +++ b/src/coreclr/jit/lsraxarch.cpp @@ -45,10 +45,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX int LinearScan::BuildNode(GenTree* tree) { assert(!tree->isContained()); - Interval* prefSrcInterval = nullptr; int srcCount; int dstCount = 0; - regMaskTP dstCandidates = RBM_NONE; regMaskTP killMask = RBM_NONE; bool isLocalDefUse = false; @@ -1088,7 +1086,6 @@ int LinearScan::BuildCall(GenTreeCall* call) // there is an explicit thisPtr but it is redundant bool callHasFloatRegArgs = false; - bool isVarArgs = call->IsVarargs(); // First, determine internal registers. // We will need one for any float arguments to a varArgs call. @@ -1723,11 +1720,10 @@ int LinearScan::BuildLclHeap(GenTree* tree) // int LinearScan::BuildModDiv(GenTree* tree) { - GenTree* op1 = tree->gtGetOp1(); - GenTree* op2 = tree->gtGetOp2(); - regMaskTP dstCandidates = RBM_NONE; - RefPosition* internalDef = nullptr; - int srcCount = 0; + GenTree* op1 = tree->gtGetOp1(); + GenTree* op2 = tree->gtGetOp2(); + regMaskTP dstCandidates = RBM_NONE; + int srcCount = 0; if (varTypeIsFloating(tree->TypeGet())) { @@ -2161,11 +2157,10 @@ int LinearScan::BuildSIMD(GenTreeSIMD* simdTree) // int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree) { - NamedIntrinsic intrinsicId = intrinsicTree->gtHWIntrinsicId; - var_types baseType = intrinsicTree->gtSIMDBaseType; - CORINFO_InstructionSet isa = HWIntrinsicInfo::lookupIsa(intrinsicId); - HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsicId); - int numArgs = HWIntrinsicInfo::lookupNumArgs(intrinsicTree); + NamedIntrinsic intrinsicId = intrinsicTree->gtHWIntrinsicId; + var_types baseType = intrinsicTree->gtSIMDBaseType; + HWIntrinsicCategory category = HWIntrinsicInfo::lookupCategory(intrinsicId); + int numArgs = HWIntrinsicInfo::lookupNumArgs(intrinsicTree); // Set the AVX Flags if this instruction may use VEX encoding for SIMD operations. // Note that this may be true even if the ISA is not AVX (e.g. for platform-agnostic intrinsics diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index a0513b7f48b3a..975f81c8bc3c9 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -2988,8 +2988,6 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) { argx = args->GetNode()->gtSkipPutArgType(); - fgArgTabEntry* argEntry = nullptr; - // Change the node to TYP_I_IMPL so we don't report GC info // NOTE: We deferred this from the importer because of the inliner. @@ -3010,12 +3008,11 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) #if !defined(OSX_ARM64_ABI) unsigned argAlignBytes = TARGET_POINTER_SIZE; #endif - unsigned size = 0; - unsigned byteSize = 0; - CORINFO_CLASS_HANDLE copyBlkClass = nullptr; - bool isRegArg = false; - bool isNonStandard = false; - regNumber nonStdRegNum = REG_NA; + unsigned size = 0; + unsigned byteSize = 0; + bool isRegArg = false; + bool isNonStandard = false; + regNumber nonStdRegNum = REG_NA; if (GlobalJitOptions::compFeatureHfa) { @@ -3214,9 +3211,6 @@ void Compiler::fgInitArgInfo(GenTreeCall* call) if (isStructArg) { - // We have an argument with a struct type, but it may be be a child of a GT_COMMA - GenTree* argObj = argx->gtEffectiveVal(true /*commaOnly*/); - assert(argx == args->GetNode()); assert(structSize != 0); @@ -3679,7 +3673,6 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // Set up the fgArgInfo. fgInitArgInfo(call); - unsigned numArgs = call->fgArgInfo->ArgCount(); JITDUMP("%sMorphing args for %d.%s:\n", (reMorphing) ? "Re" : "", call->gtTreeID, GenTree::OpName(call->gtOper)); // If we are remorphing, process the late arguments (which were determined by a previous caller). @@ -3769,9 +3762,7 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // Get information about this argument. var_types hfaType = argEntry->GetHfaType(); bool isHfaArg = (hfaType != TYP_UNDEF); - unsigned hfaSlots = argEntry->numRegs; bool passUsingFloatRegs = argEntry->isPassedInFloatRegisters(); - bool isBackFilled = argEntry->IsBackFilled(); unsigned structSize = 0; // Struct arguments may be morphed into a node that is not a struct type. @@ -4276,10 +4267,8 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) // void Compiler::fgMorphMultiregStructArgs(GenTreeCall* call) { - bool foundStructArg = false; - unsigned initialFlags = call->gtFlags; - unsigned flagsSummary = 0; - fgArgInfo* allArgInfo = call->fgArgInfo; + bool foundStructArg = false; + unsigned flagsSummary = 0; #ifdef TARGET_X86 assert(!"Logic error: no MultiregStructArgs for X86"); @@ -12767,7 +12756,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) "the return [%06u]\n", lclVar->GetLclNum(), fieldLclNum, dspTreeID(tree)); lclVar->SetLclNum(fieldLclNum); - var_types fieldType = fieldDsc->lvType; lclVar->ChangeType(fieldDsc->lvType); } } @@ -13533,8 +13521,6 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac) goto SKIP; } - LclVarDsc* varDsc = lvaTable + lclNum; - /* Set op1 to the right side of asg, (i.e. the RELOP) */ op1 = asg->AsOp()->gtOp2; @@ -18927,7 +18913,6 @@ void Compiler::fgAddFieldSeqForZeroOffset(GenTree* addr, FieldSeqNode* fieldSeqZ FieldSeqNode* fieldSeqUpdate = fieldSeqZero; GenTree* fieldSeqNode = addr; bool fieldSeqRecorded = false; - bool isMapAnnotation = false; #ifdef DEBUG if (verbose) diff --git a/src/coreclr/jit/optcse.cpp b/src/coreclr/jit/optcse.cpp index 9697185569ac2..a07d98be23b9e 100644 --- a/src/coreclr/jit/optcse.cpp +++ b/src/coreclr/jit/optcse.cpp @@ -409,7 +409,6 @@ unsigned Compiler::optValnumCSE_Index(GenTree* tree, Statement* stmt) size_t key; unsigned hval; CSEdsc* hashDsc; - bool isIntConstHash = false; bool enableSharedConstCSE = false; bool isSharedConst = false; int configValue = JitConfig.JitConstCSE(); @@ -2366,14 +2365,12 @@ class CSE_Heuristic // Each CSE Def will contain two Refs and each CSE Use will have one Ref of this new LclVar BasicBlock::weight_t cseRefCnt = (candidate->DefCount() * 2) + candidate->UseCount(); - bool canEnregister = true; - unsigned slotCount = 1; - var_types cseLclVarTyp = genActualType(candidate->Expr()->TypeGet()); + bool canEnregister = true; + unsigned slotCount = 1; if (candidate->Expr()->TypeGet() == TYP_STRUCT) { // This is a non-enregisterable struct. canEnregister = false; - GenTree* value = candidate->Expr(); CORINFO_CLASS_HANDLE structHnd = m_pCompiler->gtGetStructHandleIfPresent(candidate->Expr()); if (structHnd == NO_CLASS_HANDLE) { diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp index 13feaa6289691..ab9ddceafcbc8 100644 --- a/src/coreclr/jit/optimizer.cpp +++ b/src/coreclr/jit/optimizer.cpp @@ -3696,7 +3696,6 @@ void Compiler::optUnrollLoops() incr = incr->AsOp()->gtOp2; GenTree* init = initStmt->GetRootNode(); - GenTree* test = testStmt->GetRootNode(); /* Make sure everything looks ok */ if ((init->gtOper != GT_ASG) || (init->AsOp()->gtOp1->gtOper != GT_LCL_VAR) || diff --git a/src/coreclr/jit/simdashwintrinsic.cpp b/src/coreclr/jit/simdashwintrinsic.cpp index d50def6863f45..f81302966bac9 100644 --- a/src/coreclr/jit/simdashwintrinsic.cpp +++ b/src/coreclr/jit/simdashwintrinsic.cpp @@ -369,9 +369,8 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic, GenTree* op2 = nullptr; GenTree* op3 = nullptr; - SimdAsHWIntrinsicClassId classId = SimdAsHWIntrinsicInfo::lookupClassId(intrinsic); - unsigned numArgs = sig->numArgs; - bool isInstanceMethod = false; + unsigned numArgs = sig->numArgs; + bool isInstanceMethod = false; if (sig->hasThis()) { diff --git a/src/coreclr/jit/simdcodegenxarch.cpp b/src/coreclr/jit/simdcodegenxarch.cpp index 6897dd01954f6..f85e8b6cd4f0b 100644 --- a/src/coreclr/jit/simdcodegenxarch.cpp +++ b/src/coreclr/jit/simdcodegenxarch.cpp @@ -1486,7 +1486,6 @@ void CodeGen::genSIMDIntrinsicBinOp(GenTreeSIMD* simdNode) regNumber targetReg = simdNode->GetRegNum(); assert(targetReg != REG_NA); var_types targetType = simdNode->TypeGet(); - SIMDLevel level = compiler->getSIMDSupportLevel(); genConsumeOperands(simdNode); regNumber op1Reg = op1->GetRegNum(); diff --git a/src/coreclr/jit/valuenum.cpp b/src/coreclr/jit/valuenum.cpp index a128ae6f92959..bae645efe0d39 100644 --- a/src/coreclr/jit/valuenum.cpp +++ b/src/coreclr/jit/valuenum.cpp @@ -737,17 +737,6 @@ T ValueNumStore::EvalOpSpecialized(VNFunc vnf, T v0, T v1) break; } } - else // must be a VNF_ function - { - switch (vnf) - { - // Here we handle those that are the same for all integer types. - - default: - // For any other value of 'vnf', we will assert below - break; - } - } noway_assert(!"Unhandled operation in EvalOpSpecialized - binary"); return v0; diff --git a/src/coreclr/pal/src/libunwind/CMakeLists.txt b/src/coreclr/pal/src/libunwind/CMakeLists.txt index 5b5f904634334..44e9bc6c35eed 100644 --- a/src/coreclr/pal/src/libunwind/CMakeLists.txt +++ b/src/coreclr/pal/src/libunwind/CMakeLists.txt @@ -145,8 +145,6 @@ if(CLR_CMAKE_HOST_WIN32) add_compile_options(-wd4311) # pointer truncation from 'unw_word_t *' to 'long' add_compile_options(-wd4475) # 'fprintf' : length modifier 'L' cannot be used add_compile_options(-wd4477) # fprintf argument type - - add_compile_options(-wd9025) # overriding '/TP' with '/TC' endif (CLR_CMAKE_HOST_WIN32) if(CLR_CMAKE_TARGET_ARCH_ARM)