From 061ec94c71d80627c0e5a3563558622f9b5403e5 Mon Sep 17 00:00:00 2001 From: David Green Date: Thu, 9 Jul 2020 13:06:51 +0100 Subject: [PATCH] [BasicAA] Enable -basic-aa-recphi by default This option was added a while back, to help improve AA around pointer phi loops. It looks for phi(gep(phi, const), x) loops, checking if x can then prove more precise aliasing info. Differential Revision: https://reviews.llvm.org/D82998 --- lib/Analysis/BasicAliasAnalysis.cpp | 2 +- test/Analysis/BasicAA/phi-loop.ll | 2 +- test/Analysis/BasicAA/recphi.ll | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 74664098ce1..5574d3f5db6 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -66,7 +66,7 @@ using namespace llvm; /// Enable analysis of recursive PHI nodes. static cl::opt EnableRecPhiAnalysis("basic-aa-recphi", cl::Hidden, - cl::init(false)); + cl::init(true)); /// By default, even on 32-bit architectures we use 64-bit integers for /// calculations. This will allow us to more-aggressively decompose indexing diff --git a/test/Analysis/BasicAA/phi-loop.ll b/test/Analysis/BasicAA/phi-loop.ll index db3023c6560..e54752a9223 100644 --- a/test/Analysis/BasicAA/phi-loop.ll +++ b/test/Analysis/BasicAA/phi-loop.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -basic-aa -basic-aa-recphi=1 -gvn -S | FileCheck %s +; RUN: opt < %s -basic-aa -gvn -S | FileCheck %s ; ; Check that section->word_ofs doesn't get reloaded in every iteration of the ; for loop. diff --git a/test/Analysis/BasicAA/recphi.ll b/test/Analysis/BasicAA/recphi.ll index 130058c7456..bdd85c8f0e6 100644 --- a/test/Analysis/BasicAA/recphi.ll +++ b/test/Analysis/BasicAA/recphi.ll @@ -1,4 +1,4 @@ -; RUN: opt < %s -basic-aa -aa-eval -print-all-alias-modref-info -basic-aa-recphi -disable-output 2>&1 | FileCheck %s +; RUN: opt < %s -basic-aa -aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s ; CHECK-LABEL: Function: simple: 5 pointers, 0 call sites ; CHECK: NoAlias: float* %src1, float* %src2