|
| 1 | +/*========================== begin_copyright_notice ============================ |
| 2 | + |
| 3 | +Copyright (C) 2023 Intel Corporation |
| 4 | + |
| 5 | +SPDX-License-Identifier: MIT |
| 6 | + |
| 7 | +============================= end_copyright_notice ===========================*/ |
| 8 | + |
| 9 | +/*========================== begin_copyright_notice ============================ |
| 10 | + |
| 11 | +Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 12 | +See https://llvm.org/LICENSE.txt for license information. |
| 13 | +SPDX-License-Identifier: Apache-2.0 with LLVM-exception |
| 14 | + |
| 15 | +============================= end_copyright_notice ===========================*/ |
| 16 | + |
| 17 | +# Description: |
| 18 | +# Disable the option to avoid shortening of llvm.memset, which isn't supported |
| 19 | +# by our memset lowering / LowerGEPForPrivMem pass, and leads to suboptimal CG. |
| 20 | +# |
| 21 | +# Shortening sequence to avoid: |
| 22 | +# call void @llvm.memset.p0i8.i64(i8* %ptr, i8 0, i64 64, i1 false) |
| 23 | +# -> |
| 24 | +# %gep = getelementptr inbounds i8, i8* %ptr, i64 40 |
| 25 | +# call void @llvm.memset.p0i8.i64(i8* %gep, i8 0, i64 24, i1 false) |
| 26 | +# |
| 27 | +# TODO: Improve memset handling / GEP to extract/insertelement lowering, then |
| 28 | +# abandon this patch. |
| 29 | + |
| 30 | +diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp |
| 31 | +index c5c8e880e..e620493d8 100644 |
| 32 | +--- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp |
| 33 | ++++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp |
| 34 | +@@ -113,7 +113,7 @@ DEBUG_COUNTER(MemorySSACounter, "dse-memoryssa", |
| 35 | + |
| 36 | + static cl::opt<bool> |
| 37 | + EnablePartialOverwriteTracking("enable-dse-partial-overwrite-tracking", |
| 38 | +- cl::init(true), cl::Hidden, |
| 39 | ++ cl::init(false), cl::Hidden, |
| 40 | + cl::desc("Enable partial-overwrite tracking in DSE")); |
| 41 | + |
| 42 | + static cl::opt<bool> |
| 43 | + |
0 commit comments