diff options
| author | Alina Sbirlea <asbirlea@google.com> | 2019-08-21 17:00:57 +0000 |
|---|---|---|
| committer | Alina Sbirlea <asbirlea@google.com> | 2019-08-21 17:00:57 +0000 |
| commit | 7425179fee9b4ed1ff6d366ee06487f05a1c0ab3 (patch) | |
| tree | 42f533a45605d2614eaef25446aec5cd03471ad1 /llvm/test/Analysis/BasicAA | |
| parent | 954a012b4c75db77b99b259d9cc4edd8ab551c68 (diff) | |
| download | bcm5719-llvm-7425179fee9b4ed1ff6d366ee06487f05a1c0ab3.tar.gz bcm5719-llvm-7425179fee9b4ed1ff6d366ee06487f05a1c0ab3.zip | |
[LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it.
Summary:
Add a flag to the FunctionToLoopAdaptor that allows enabling MemorySSA only for the loop pass managers that are known to preserve it.
If an LPM is known to have only loop transforms that *all* preserve MemorySSA, then use MemorySSA if `EnableMSSALoopDependency` is set.
If an LPM has loop passes that do not preserve MemorySSA, then the flag passed is `false`, regardless of the value of `EnableMSSALoopDependency`.
When using a custom loop pass pipeline via `passes=...`, use keyword `loop` vs `loop-mssa` to use MemorySSA in that LPM. If a loop that does not preserve MemorySSA is added while using the `loop-mssa` keyword, that's an error.
Add the new `loop-mssa` keyword to a few tests where a difference occurs when enabling MemorySSA.
Reviewers: chandlerc
Subscribers: mehdi_amini, Prazek, george.burgess.iv, sanjoy.google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66376
llvm-svn: 369548
Diffstat (limited to 'llvm/test/Analysis/BasicAA')
| -rw-r--r-- | llvm/test/Analysis/BasicAA/store-promote.ll | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/test/Analysis/BasicAA/store-promote.ll b/llvm/test/Analysis/BasicAA/store-promote.ll index afe11c2a148..23b74bc1aef 100644 --- a/llvm/test/Analysis/BasicAA/store-promote.ll +++ b/llvm/test/Analysis/BasicAA/store-promote.ll @@ -1,8 +1,9 @@ -; Test that LICM uses basicaa to do alias analysis, which is capable of +; Test that LICM uses basicaa to do alias analysis, which is capable of ; disambiguating some obvious cases. If LICM is able to disambiguate the ; two pointers, then the load should be hoisted, and the store sunk. -; RUN: opt < %s -basicaa -licm -S | FileCheck %s +; RUN: opt < %s -basicaa -licm -enable-mssa-loop-dependency=false -S | FileCheck %s -check-prefixes=CHECK,AST +; RUN: opt < %s -basicaa -licm -enable-mssa-loop-dependency=true -S | FileCheck %s -check-prefixes=CHECK,MSSA target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" @A = global i32 7 ; <i32*> [#uses=3] @@ -25,10 +26,13 @@ Out: ; preds = %Loop ; The Loop block should be empty after the load/store are promoted. ; CHECK: @test1 ; CHECK: load i32, i32* @A +; MSSA: load i32, i32* @A +; MSSA: store i32 %Atmp, i32* @B ; CHECK: Loop: ; CHECK-NEXT: br i1 %c, label %Out, label %Loop ; CHECK: Out: -; CHECK: store i32 %Atmp, i32* @B +; AST: store i32 %Atmp, i32* @B +; AST: load i32, i32* @A } define i32 @test2(i1 %c) { |

