From 7de410440d46e83aa81aed19a4215a92798c5eb5 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Wed, 1 Dec 2021 08:29:23 +0000 Subject: [PATCH] [DSE] Allow DSE to optimize MemorySSA by default. This allows for better optimization of 'stores-of-existing-values' and possibly helps passes further down the pipeline. Reviewed By: asbirlea Differential Revision: https://reviews.llvm.org/D113712 --- llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp | 4 ++-- .../DeadStoreElimination/stores-of-existing-values.ll | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp index 3646d3f3017d..e0d3a6accadd 100644 --- a/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp +++ b/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp @@ -166,8 +166,8 @@ static cl::opt MemorySSAPathCheckLimit( // those cases, the flag can be used to check if DSE's MemorySSA optimizations // impact follow-up passes. static cl::opt - OptimizeMemorySSA("dse-optimize-memoryssa", cl::init(false), cl::Hidden, - cl::desc("Allow DSE to optimize memory accesses")); + OptimizeMemorySSA("dse-optimize-memoryssa", cl::init(true), cl::Hidden, + cl::desc("Allow DSE to optimize memory accesses.")); //===----------------------------------------------------------------------===// // Helper functions diff --git a/llvm/test/Transforms/DeadStoreElimination/stores-of-existing-values.ll b/llvm/test/Transforms/DeadStoreElimination/stores-of-existing-values.ll index 7faf06c53217..b3bc95f4c775 100644 --- a/llvm/test/Transforms/DeadStoreElimination/stores-of-existing-values.ll +++ b/llvm/test/Transforms/DeadStoreElimination/stores-of-existing-values.ll @@ -1,7 +1,7 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; RUN: opt -basic-aa -dse -dse-optimize-memoryssa=false -S %s | FileCheck --check-prefixes=CHECK,UNOPT %s ; RUN: opt -basic-aa -dse -dse-optimize-memoryssa -S %s | FileCheck --check-prefixes=CHECK,OPT %s -; RUN: opt -basic-aa -dse -S %s | FileCheck --check-prefixes=CHECK,UNOPT %s +; RUN: opt -basic-aa -dse -S %s | FileCheck --check-prefixes=CHECK,OPT %s target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"