diff --git a/compiler/control/OMROptions.cpp b/compiler/control/OMROptions.cpp index 55d52b82a10..68d018999e7 100644 --- a/compiler/control/OMROptions.cpp +++ b/compiler/control/OMROptions.cpp @@ -251,6 +251,8 @@ TR::OptionTable OMR::Options::_jitOptions[] = { {"disableAOTStaticField", "O\tdisable AOT static field inlining", SET_OPTION_BIT(TR_DisableAOTStaticField), "F"}, {"disableAOTValidationOpts", "O\tdisable AOT optimizations with validations", SET_OPTION_BIT(TR_DisableAOTCheckCastInlining | TR_DisableAOTInstanceOfInlining | TR_DisableAOTInstanceFieldResolution | TR_DisableAOTStaticField), "F"}, {"disableAOTWarmRunThroughputImprovement", "O\tdisable change iprofiler entry choosing heuristic to improve aot warm run throughput", SET_OPTION_BIT(TR_DisableAOTWarmRunThroughputImprovement), "F"}, + {"disableArrayCopyByteArrayInlineSmallSizeWithoutREPMOVS", "O\tdisable array copy optimizations enhancement for 8 bit primitive array", SET_OPTION_BIT(TR_Disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS), "F"}, + {"disableArrayCopyCharArrayInlineSmallSizeWithoutREPMOVS", "O\tdisable array copy optimizations enhancement for 16 bit primitive array", SET_OPTION_BIT(TR_Disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS), "F"}, {"disableArrayCopyOpts", "O\tdisable array copy optimizations", SET_OPTION_BIT(TR_DisableArrayCopyOpts), "F"}, {"disableArraySetOpts", "O\tdisable array set optimizations", SET_OPTION_BIT(TR_DisableArraySetOpts), "F"}, {"disableArraySetStoreElimination", "O\tdisable arrayset store elimination", SET_OPTION_BIT(TR_DisableArraysetStoreElimination), "F"}, diff --git a/compiler/control/OMROptions.hpp b/compiler/control/OMROptions.hpp index 530a55979f8..2c17207cfff 100644 --- a/compiler/control/OMROptions.hpp +++ b/compiler/control/OMROptions.hpp @@ -311,9 +311,9 @@ enum TR_CompilationOptions TR_DisableCHOpts = 0x00040000 + 7, TR_ForceLoadAOT = 0x00080000 + 7, TR_TraceRelocatableDataCG = 0x00100000 + 7, - // Available = 0x00200000 + 7, + TR_Disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = 0x00200000 + 7, TR_TraceRelocatableDataDetailsCG = 0x00400000 + 7, - // Available = 0x00800000 + 7, + TR_Disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = 0x00800000 + 7, TR_TurnOffSelectiveNoOptServerIfNoStartupHint = 0x01000000 + 7, TR_TraceDominators = 0x02000000 + 7, TR_EnableHCR = 0x04000000 + 7, // enable hot code replacement diff --git a/compiler/x/codegen/OMRTreeEvaluator.cpp b/compiler/x/codegen/OMRTreeEvaluator.cpp index a805fea4982..f7c00575363 100644 --- a/compiler/x/codegen/OMRTreeEvaluator.cpp +++ b/compiler/x/codegen/OMRTreeEvaluator.cpp @@ -2259,9 +2259,11 @@ static void arrayCopy8BitPrimitiveInlineSmallSizeWithoutREPMOVS(TR::Node* node, static void arrayCopyDefault(TR::Node* node, uint8_t elementSize, TR::Register* dstReg, TR::Register* srcReg, TR::Register* sizeReg, TR::CodeGenerator* cg) { static bool disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = (feGetEnv("TR_Disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS") != NULL); + bool disableEnhancement = disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS || + cg->comp()->getOption(TR_Disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS); bool enable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = ((elementSize == 1) && - !disable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS && + !disableEnhancement && cg->comp()->target().cpu.supportsAVX() && cg->comp()->target().is64Bit()) ? true : false; if (enable8BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS) @@ -2731,8 +2733,10 @@ TR::Register *OMR::X86::TreeEvaluator::arraycopyEvaluator(TR::Node *node, TR::Co else if (elementSize == 2 && !useREPMOVSW) { static bool disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = feGetEnv("TR_Disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS") != NULL; + bool disableEnhancement = disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS + || cg->comp()->getOption(TR_Disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS); - bool enable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = (!disable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS && + bool enable16BitPrimitiveArrayCopyInlineSmallSizeWithoutREPMOVS = (!disableEnhancement && cg->comp()->target().cpu.supportsAVX() && cg->comp()->target().is64Bit()) ? true : false;