Commit 35e16002 by Jim Stichnoth

Subzero: Use the memset inline threshold for memset.

Memset lowering was using the memcpy inline threshold instead of the memset threshold. Using the memset threshold as specified (16) seems to make spec2k performance slightly worse, so change it to the original value (8). BUG= none R=eholk@chromium.org Review URL: https://codereview.chromium.org/2217983003 .
parent a41e9a14
......@@ -711,7 +711,7 @@ public:
/// @{
static constexpr uint32_t MEMCPY_UNROLL_LIMIT = 8;
static constexpr uint32_t MEMMOVE_UNROLL_LIMIT = 8;
static constexpr uint32_t MEMSET_UNROLL_LIMIT = 16;
static constexpr uint32_t MEMSET_UNROLL_LIMIT = 8;
/// @}
/// Value is in bytes. Return Value adjusted to the next highest multiple of
......
......@@ -762,7 +762,7 @@ public:
/// @{
static constexpr uint32_t MEMCPY_UNROLL_LIMIT = 8;
static constexpr uint32_t MEMMOVE_UNROLL_LIMIT = 8;
static constexpr uint32_t MEMSET_UNROLL_LIMIT = 16;
static constexpr uint32_t MEMSET_UNROLL_LIMIT = 8;
/// @}
/// Value is in bytes. Return Value adjusted to the next highest multiple of
......
......@@ -5015,13 +5015,13 @@ void TargetX86Base<TraitsType>::lowerMemset(Operand *Dest, Operand *Val,
// memory unit as the access to the same memory are far apart.
Type Ty;
if (ValValue == 0 && CountValue >= BytesPerStoreq &&
CountValue <= BytesPerStorep * Traits::MEMCPY_UNROLL_LIMIT) {
CountValue <= BytesPerStorep * Traits::MEMSET_UNROLL_LIMIT) {
// When the value is zero it can be loaded into a vector register cheaply
// using the xor trick.
Base = legalizeToReg(Dest);
VecReg = makeVectorOfZeros(IceType_v16i8);
Ty = largestTypeInSize(CountValue);
} else if (CountValue <= BytesPerStorei32 * Traits::MEMCPY_UNROLL_LIMIT) {
} else if (CountValue <= BytesPerStorei32 * Traits::MEMSET_UNROLL_LIMIT) {
// When the value is non-zero or the count is small we can't use vector
// instructions so are limited to 32-bit stores.
Base = legalizeToReg(Dest);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment