[PATCH] D88118: [test][NewPM] Make dead-uses.ll work under NPM

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 15:28:33 PDT 2020


aeubanks created this revision.
aeubanks added reviewers: asbirlea, ychen.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
aeubanks requested review of this revision.

This one is weird...

globals-aa needs to be already computed at licm, or else a function pass
can't run a module analysis and won't have access to globals-aa.
But the globals-aa result is impacted by instcombine in a way that
affects what the test is expecting. If globals-aa is computed before
instcombine, it is cached and globals-aa used in licm won't contain the
necessary info provided by instcombine.
Another catch is that if we don't invalidate AAManager, it will use the
cached AAManager that instcombine requested, which may not contain
globals-aa. So we have to invalidate<aa> so that licm can recompute
an AAManager with the globals-aa created by the require<globals-aa>.

This is essentially the problem described in https://reviews.llvm.org/D84259.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88118

Files:
  llvm/test/Analysis/GlobalsModRef/dead-uses.ll


Index: llvm/test/Analysis/GlobalsModRef/dead-uses.ll
===================================================================
--- llvm/test/Analysis/GlobalsModRef/dead-uses.ll
+++ llvm/test/Analysis/GlobalsModRef/dead-uses.ll
@@ -1,4 +1,5 @@
-; RUN: opt < %s -instcombine -globals-aa -licm -S | FileCheck %s
+; RUN: opt < %s -instcombine -globals-aa -licm -enable-new-pm=0 -S | FileCheck %s
+; RUN: opt < %s -aa-pipeline=basic-aa,globals-aa -passes='function(instcombine),require<globals-aa>,function(invalidate<aa>,loop(licm))' -S | FileCheck %s
 
 ; Make sure -globals-aa ignores dead uses of globals.
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88118.293578.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200922/79892a92/attachment.bin>


More information about the llvm-commits mailing list