Skip to content

Commit

Permalink
i#4610: Fix VS2017 OOM by splitting avx512 test files (#4611)
Browse files Browse the repository at this point in the history
Splits off about half of
suite/tests/api/ir_x86_4args_avx512_evex_mask_B.h into a new _C file
to avoid an out-of-memory in VS2017 on Github Actions.
The recent AVX-512 broadcast additions for #4534 in PR #4577 seem to
have pushed it over the edge.

Issue: #4534, #4610, #4131, #4549
Fixes #4610
  • Loading branch information
derekbruening authored Dec 14, 2020
1 parent 586ea28 commit 733e82b
Show file tree
Hide file tree
Showing 5 changed files with 1,978 additions and 1,918 deletions.
1 change: 1 addition & 0 deletions suite/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,7 @@ if (CLIENT_INTERFACE)
${CMAKE_CURRENT_SOURCE_DIR}/api/ir_${sfx}_3args_avx512_vex.h
${CMAKE_CURRENT_SOURCE_DIR}/api/ir_${sfx}_4args_avx512_evex_mask_A.h
${CMAKE_CURRENT_SOURCE_DIR}/api/ir_${sfx}_4args_avx512_evex_mask_B.h
${CMAKE_CURRENT_SOURCE_DIR}/api/ir_${sfx}_4args_avx512_evex_mask_C.h
${CMAKE_CURRENT_SOURCE_DIR}/api/ir_${sfx}_5args_avx512_evex_mask.h)
append_property_string(SOURCE api/ir_${sfx}.c OBJECT_DEPENDS "${api_ir_headers}")
endif ()
Expand Down
32 changes: 28 additions & 4 deletions suite/tests/api/ir_x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ test_all_opcodes_4(void *dc)
# undef INCLUDE_NAME
}

/* Part A: Split in half to avoid a VS2013 compiler bug i#3992.
/* Part A: Split up to avoid VS running out of memory (i#3992,i#4610).
* (The _scaled_disp8 versions are what hit the OOM but we split this one too.)
*/
static void
Expand All @@ -461,7 +461,7 @@ test_all_opcodes_4_avx512_evex_mask_A(void *dc)
# undef INCLUDE_NAME
}

/* Part B: Split in half to avoid a VS2013 compiler bug i#3992.
/* Part B: Split up to avoid VS running out of memory (i#3992,i#4610).
* (The _scaled_disp8 versions are what hit the OOM but we split this one too.)
*/
static void
Expand All @@ -472,7 +472,18 @@ test_all_opcodes_4_avx512_evex_mask_B(void *dc)
# undef INCLUDE_NAME
}

/* Part A: Split in half to avoid a VS2013 compiler bug i#3992. */
/* Part C: Split up to avoid VS running out of memory (i#3992,i#4610).
* (The _scaled_disp8 versions are what hit the OOM but we split this one too.)
*/
static void
test_all_opcodes_4_avx512_evex_mask_C(void *dc)
{
# define INCLUDE_NAME "ir_x86_4args_avx512_evex_mask_C.h"
# include "ir_x86_all_opc.h"
# undef INCLUDE_NAME
}

/* Part A: Split up to avoid VS running out of memory (i#3992,i#4610). */
static void
test_all_opcodes_4_avx512_evex_mask_scaled_disp8_A(void *dc)
{
Expand All @@ -483,7 +494,7 @@ test_all_opcodes_4_avx512_evex_mask_scaled_disp8_A(void *dc)
# undef INCLUDE_NAME
}

/* Part B: Split in half to avoid a VS2013 compiler bug i#3992. */
/* Part B: Split up to avoid VS running out of memory (i#3992,i#4610). */
static void
test_all_opcodes_4_avx512_evex_mask_scaled_disp8_B(void *dc)
{
Expand All @@ -494,6 +505,17 @@ test_all_opcodes_4_avx512_evex_mask_scaled_disp8_B(void *dc)
# undef INCLUDE_NAME
}

/* Part C: Split up to avoid VS running out of memory (i#3992,i#4610). */
static void
test_all_opcodes_4_avx512_evex_mask_scaled_disp8_C(void *dc)
{
# define INCLUDE_NAME "ir_x86_4args_avx512_evex_mask_C.h"
memarg_disp = EVEX_SCALABLE_DISP;
# include "ir_x86_all_opc.h"
memarg_disp = DEFAULT_DISP;
# undef INCLUDE_NAME
}

# undef OPCODE_FOR_CREATE
# undef XOPCODE_FOR_CREATE

Expand Down Expand Up @@ -2436,6 +2458,7 @@ main(int argc, char *argv[])
test_all_opcodes_5_avx512_evex_mask(dcontext);
test_all_opcodes_4_avx512_evex_mask_A(dcontext);
test_all_opcodes_4_avx512_evex_mask_B(dcontext);
test_all_opcodes_4_avx512_evex_mask_C(dcontext);
test_all_opcodes_4_avx512_evex(dcontext);
test_all_opcodes_3_avx512_evex(dcontext);
test_all_opcodes_2_avx512_evex(dcontext);
Expand All @@ -2448,6 +2471,7 @@ main(int argc, char *argv[])
test_all_opcodes_5_avx512_evex_mask_scaled_disp8(dcontext);
test_all_opcodes_4_avx512_evex_mask_scaled_disp8_A(dcontext);
test_all_opcodes_4_avx512_evex_mask_scaled_disp8_B(dcontext);
test_all_opcodes_4_avx512_evex_mask_scaled_disp8_C(dcontext);
test_all_opcodes_4_avx512_evex_scaled_disp8(dcontext);
test_all_opcodes_3_avx512_evex_scaled_disp8(dcontext);
test_all_opcodes_2_avx512_evex_scaled_disp8(dcontext);
Expand Down
4 changes: 2 additions & 2 deletions suite/tests/api/ir_x86_4args_avx512_evex_mask_A.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* **********************************************************
* Copyright (c) 2019 Google, Inc. All rights reserved.
* Copyright (c) 2019-2020 Google, Inc. All rights reserved.
* **********************************************************/

/*
Expand Down Expand Up @@ -31,7 +31,7 @@
*/

/* AVX-512 EVEX instructions with 1 destination, 1 mask and 2 sources.
* Part A: Split in half to avoid a VS2013 compiler bug i#3992.
* Part A: Split up to avoid VS running out of memory (i#3992,i#4610).
*/
OPCODE(vmovss_xlok0xlo, vmovss, vmovss_NDS_mask, 0, REGARG(XMM0), REGARG(K0),
REGARG_PARTIAL(XMM1, OPSZ_12), REGARG_PARTIAL(XMM2, OPSZ_4))
Expand Down
Loading

0 comments on commit 733e82b

Please sign in to comment.