1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[FunctionAttrs] Rename functionattrs -> function-attrs

To match NewPM pass name, and also for readability.
Also rename rpo-functionattrs -> rpo-function-attrs while we're here.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D84694
This commit is contained in:
Arthur Eubanks 2020-07-28 09:08:08 -07:00
parent 80f2062695
commit 8a584da153
47 changed files with 62 additions and 60 deletions

View File

@ -522,9 +522,9 @@ instructions that are obviously dead.
A trivial dead store elimination that only considers basic-block local
redundant stores.
.. _passes-functionattrs:
.. _passes-function-attrs:
``-functionattrs``: Deduce function attributes
``-function-attrs``: Deduce function attributes
----------------------------------------------
A simple interprocedural pass which walks the call-graph, looking for functions
@ -651,7 +651,7 @@ This pass can also simplify calls to specific well-known function calls (e.g.
runtime library functions). For example, a call ``exit(3)`` that occurs within
the ``main()`` function can be transformed into simply ``return 3``. Whether or
not library calls are simplified is controlled by the
:ref:`-functionattrs <passes-functionattrs>` pass and LLVM's knowledge of
:ref:`-function-attrs <passes-function-attrs>` pass and LLVM's knowledge of
library calls on different targets.
.. _passes-aggressive-instcombine:

View File

@ -81,7 +81,7 @@ MODULE_PASS("print-lcg-dot", LazyCallGraphDOTPrinterPass(dbgs()))
MODULE_PASS("print-stack-safety", StackSafetyGlobalPrinterPass(dbgs()))
MODULE_PASS("rewrite-statepoints-for-gc", RewriteStatepointsForGC())
MODULE_PASS("rewrite-symbols", RewriteSymbolPass())
MODULE_PASS("rpo-functionattrs", ReversePostOrderFunctionAttrsPass())
MODULE_PASS("rpo-function-attrs", ReversePostOrderFunctionAttrsPass())
MODULE_PASS("sample-profile", SampleProfileLoaderPass())
MODULE_PASS("scc-oz-module-inliner",
buildInlinerPipeline(OptimizationLevel::Oz, ThinLTOPhase::None, DebugLogging))

View File

@ -1541,9 +1541,9 @@ int bar() { return foo("abcd"); }
//===---------------------------------------------------------------------===//
functionattrs doesn't know much about memcpy/memset. This function should be
function-attrs doesn't know much about memcpy/memset. This function should be
marked readnone rather than readonly, since it only twiddles local memory, but
functionattrs doesn't handle memset/memcpy/memmove aggressively:
function-attrs doesn't handle memset/memcpy/memmove aggressively:
struct X { int *p; int *q; };
int foo() {
@ -1557,7 +1557,7 @@ int foo() {
}
This can be seen at:
$ clang t.c -S -o - -mkernel -O0 -emit-llvm | opt -functionattrs -S
$ clang t.c -S -o - -mkernel -O0 -emit-llvm | opt -function-attrs -S
//===---------------------------------------------------------------------===//

View File

@ -63,7 +63,7 @@
using namespace llvm;
#define DEBUG_TYPE "functionattrs"
#define DEBUG_TYPE "function-attrs"
STATISTIC(NumReadNone, "Number of functions marked readnone");
STATISTIC(NumReadOnly, "Number of functions marked readonly");
@ -1477,11 +1477,11 @@ struct PostOrderFunctionAttrsLegacyPass : public CallGraphSCCPass {
} // end anonymous namespace
char PostOrderFunctionAttrsLegacyPass::ID = 0;
INITIALIZE_PASS_BEGIN(PostOrderFunctionAttrsLegacyPass, "functionattrs",
INITIALIZE_PASS_BEGIN(PostOrderFunctionAttrsLegacyPass, "function-attrs",
"Deduce function attributes", false, false)
INITIALIZE_PASS_DEPENDENCY(AssumptionCacheTracker)
INITIALIZE_PASS_DEPENDENCY(CallGraphWrapperPass)
INITIALIZE_PASS_END(PostOrderFunctionAttrsLegacyPass, "functionattrs",
INITIALIZE_PASS_END(PostOrderFunctionAttrsLegacyPass, "function-attrs",
"Deduce function attributes", false, false)
Pass *llvm::createPostOrderFunctionAttrsLegacyPass() {
@ -1542,11 +1542,13 @@ struct ReversePostOrderFunctionAttrsLegacyPass : public ModulePass {
char ReversePostOrderFunctionAttrsLegacyPass::ID = 0;
INITIALIZE_PASS_BEGIN(ReversePostOrderFunctionAttrsLegacyPass, "rpo-functionattrs",
"Deduce function attributes in RPO", false, false)
INITIALIZE_PASS_BEGIN(ReversePostOrderFunctionAttrsLegacyPass,
"rpo-function-attrs", "Deduce function attributes in RPO",
false, false)
INITIALIZE_PASS_DEPENDENCY(CallGraphWrapperPass)
INITIALIZE_PASS_END(ReversePostOrderFunctionAttrsLegacyPass, "rpo-functionattrs",
"Deduce function attributes in RPO", false, false)
INITIALIZE_PASS_END(ReversePostOrderFunctionAttrsLegacyPass,
"rpo-function-attrs", "Deduce function attributes in RPO",
false, false)
Pass *llvm::createReversePostOrderFunctionAttrsPass() {
return new ReversePostOrderFunctionAttrsLegacyPass();

View File

@ -1,4 +1,4 @@
; RUN: opt -mtriple=s390x-linux-gnu -mcpu=z13 -enable-mssa-loop-dependency -verify-memoryssa -sroa -globalopt -functionattrs -simplifycfg -licm -loop-unswitch %s -S | FileCheck %s
; RUN: opt -mtriple=s390x-linux-gnu -mcpu=z13 -enable-mssa-loop-dependency -verify-memoryssa -sroa -globalopt -function-attrs -simplifycfg -licm -loop-unswitch %s -S | FileCheck %s
; REQUIRES: asserts
target datalayout = "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -tbaa -basic-aa -functionattrs -S | FileCheck %s
; RUN: opt < %s -tbaa -basic-aa -function-attrs -S | FileCheck %s
; FunctionAttrs should make use of TBAA.

View File

@ -1,4 +1,4 @@
; RUN: opt -debug-pass=Executions -globals-aa -functionattrs -disable-output < %s 2>&1 | FileCheck %s
; RUN: opt -debug-pass=Executions -globals-aa -function-attrs -disable-output < %s 2>&1 | FileCheck %s
; CHECK: Executing Pass 'Globals Alias Analysis'
; CHECK-NOT: Freeing Pass 'Globals Alias Analysis'

View File

@ -1,7 +1,7 @@
; RUN: opt < %s -globals-aa -functionattrs | \
; RUN: opt < %s -globals-aa -function-attrs | \
; RUN: opt -S -strip -strip-dead-prototypes -strip-named-metadata > %t.no_dbg
; RUN: opt < %s -debugify-each -globals-aa -functionattrs | \
; RUN: opt < %s -debugify-each -globals-aa -function-attrs | \
; RUN: opt -S -strip -strip-dead-prototypes -strip-named-metadata > %t.with_dbg
; RUN: diff %t.no_dbg %t.with_dbg

View File

@ -1,4 +1,4 @@
; RUN: opt -S -functionattrs < %s | FileCheck %s
; RUN: opt -S -function-attrs < %s | FileCheck %s
declare void @f_readonly() readonly
declare void @f_readnone() readnone

View File

@ -1,4 +1,4 @@
; RUN: opt -S -globals-aa -functionattrs < %s | FileCheck %s
; RUN: opt -S -globals-aa -function-attrs < %s | FileCheck %s
; RUN: opt -S -O3 < %s | FileCheck %s
; Apart from checking for the direct cause of the bug, we also check

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; CHECK: Function Attrs

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -basic-aa -functionattrs -S | FileCheck %s
; RUN: opt < %s -basic-aa -function-attrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes=function-attrs -S | FileCheck %s
@x = global i32 0

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -basic-aa -functionattrs -S | FileCheck %s
; RUN: opt < %s -basic-aa -function-attrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes=function-attrs -S | FileCheck %s
; CHECK: define i32 @f() #0

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; PR2792

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -basic-aa -functionattrs -S | FileCheck %s
; RUN: opt < %s -basic-aa -function-attrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes=function-attrs -S | FileCheck %s
@s = external constant i8 ; <i8*> [#uses=1]

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; CHECK: define i32* @a(i32** nocapture readonly %p)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; PR8279

View File

@ -1,4 +1,4 @@
; RUN: opt -functionattrs -S < %s | FileCheck %s --check-prefix=FNATTR
; RUN: opt -function-attrs -S < %s | FileCheck %s --check-prefix=FNATTR
;
; Test cases specifically designed for the "returned" argument attribute.
; We use FIXME's to indicate problems and missing attributes.

View File

@ -1,4 +1,4 @@
; RUN: opt -S -o - -functionattrs %s | FileCheck %s
; RUN: opt -S -o - -function-attrs %s | FileCheck %s
; RUN: opt -S -o - -passes=function-attrs %s | FileCheck %s
; CHECK-NOT: readnone

View File

@ -1,4 +1,4 @@
; RUN: opt -basic-aa -functionattrs -S < %s | FileCheck %s
; RUN: opt -basic-aa -function-attrs -S < %s | FileCheck %s
; RUN: opt -aa-pipeline=basic-aa -passes=function-attrs -S < %s | FileCheck %s
; Atomic load/store to local doesn't affect whether a function is

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; See PR26774

View File

@ -1,7 +1,7 @@
; FIXME: convert CHECK-INDIRECT into CHECK (and remove -check-prefixes) as soon
; FIXME: as new-pass-manager's handling of indirect_non_convergent_call is fixed
;
; RUN: opt -functionattrs -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-INDIRECT
; RUN: opt -function-attrs -S < %s | FileCheck %s --check-prefixes=CHECK,CHECK-INDIRECT
; RUN: opt -passes=function-attrs -S < %s | FileCheck %s
; CHECK: Function Attrs

View File

@ -1,4 +1,4 @@
; RUN: opt -S -o - -functionattrs %s | FileCheck %s
; RUN: opt -S -o - -function-attrs %s | FileCheck %s
; RUN: opt -S -o - -passes=function-attrs %s | FileCheck %s
; Verify we remove argmemonly/inaccessiblememonly/inaccessiblemem_or_argmemonly

View File

@ -1,4 +1,4 @@
; RUN: opt -S < %s -functionattrs | FileCheck %s
; RUN: opt -S < %s -function-attrs | FileCheck %s
; RUN: opt -S < %s -passes=function-attrs | FileCheck %s
; CHECK: Function Attrs

View File

@ -1,4 +1,4 @@
; RUN: opt -S -functionattrs %s | FileCheck %s
; RUN: opt -S -function-attrs %s | FileCheck %s
; RUN: opt -S -passes='function-attrs' %s | FileCheck %s
; Don't change the attributes of parameters of naked functions, in particular

View File

@ -1,4 +1,4 @@
; RUN: opt -functionattrs -S < %s | FileCheck %s --check-prefixes=FNATTR
; RUN: opt -function-attrs -S < %s | FileCheck %s --check-prefixes=FNATTR
; RUN: opt -passes=function-attrs -S < %s | FileCheck %s --check-prefixes=FNATTR
@g = global i32* null ; <i32**> [#uses=1]

View File

@ -1,4 +1,4 @@
; RUN: opt -functionattrs --disable-nofree-inference=false -S < %s | FileCheck %s --check-prefix=FNATTR
; RUN: opt -function-attrs --disable-nofree-inference=false -S < %s | FileCheck %s --check-prefix=FNATTR
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

View File

@ -1,4 +1,4 @@
; RUN: opt -S -functionattrs %s | FileCheck %s
; RUN: opt -S -function-attrs %s | FileCheck %s
; RUN: opt -S -passes=function-attrs %s | FileCheck %s
@a = external global i8, !absolute_symbol !0

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -functionattrs -enable-nonnull-arg-prop %s | FileCheck %s --check-prefixes=FNATTR
; RUN: opt -S -function-attrs -enable-nonnull-arg-prop %s | FileCheck %s --check-prefixes=FNATTR
; RUN: opt -S -passes=function-attrs -enable-nonnull-arg-prop %s | FileCheck %s --check-prefixes=FNATTR
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"

View File

@ -1,5 +1,5 @@
; RUN: opt < %s -basic-aa -functionattrs -rpo-functionattrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes='cgscc(function-attrs),rpo-functionattrs' -S | FileCheck %s
; RUN: opt < %s -basic-aa -function-attrs -rpo-function-attrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes='cgscc(function-attrs),rpo-function-attrs' -S | FileCheck %s
; CHECK: Function Attrs
; CHECK-SAME: norecurse nounwind readnone

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; TEST 1
; CHECK: Function Attrs: norecurse nounwind readnone

View File

@ -1,4 +1,4 @@
; RUN: opt -S -functionattrs < %s | FileCheck %s
; RUN: opt -S -function-attrs < %s | FileCheck %s
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s
define void @f() {

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
@x = global i32 0

View File

@ -1,4 +1,4 @@
; RUN: opt -functionattrs -S < %s | FileCheck %s
; RUN: opt -function-attrs -S < %s | FileCheck %s
; RUN: opt -passes=function-attrs -S < %s | FileCheck %s
; This checks for an iterator wraparound bug in FunctionAttrs. The previous

View File

@ -1,4 +1,4 @@
; RUN: opt -S -functionattrs < %s | FileCheck %s
; RUN: opt -S -function-attrs < %s | FileCheck %s
; RUN: opt -S -passes=function-attrs < %s | FileCheck %s
@i = global i32 0

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -aa-pipeline=basic-aa -passes='cgscc(function-attrs)' -S | FileCheck %s
@x = global i32 0
@ -130,7 +130,7 @@ declare void @escape_readonly_ptr(i8** %addr, i8* readonly %ptr)
; is marked as readnone/only. However, the functions can write the pointer into
; %addr, causing the store to write to %escaped_then_written.
;
; FIXME: This test currently exposes a bug in functionattrs!
; FIXME: This test currently exposes a bug in function-attrs!
;
; CHECK: define void @unsound_readnone(i8* nocapture readnone %ignored, i8* readnone %escaped_then_written)
; CHECK: define void @unsound_readonly(i8* nocapture readnone %ignored, i8* readonly %escaped_then_written)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; CHECK: define void @bar(i8* nocapture readnone %0)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; CHECK: define i32 @test1(i32 %p, i32 %q)

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -functionattrs -S | FileCheck %s
; RUN: opt < %s -function-attrs -S | FileCheck %s
; RUN: opt < %s -passes=function-attrs -S | FileCheck %s
; CHECK: define void @nouses-argworn-funrn(i32* nocapture readnone %.aaa) #0 {

View File

@ -3,7 +3,7 @@
; to assert when global DCE deletes the body of the function.
;
; RUN: opt -disable-output < %s -passes='module(function(jump-threading),globaldce)'
; RUN: opt -disable-output < %s -passes='module(rpo-functionattrs,globaldce)'
; RUN: opt -disable-output < %s -passes='module(rpo-function-attrs,globaldce)'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

View File

@ -1,5 +1,5 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -disable-nounwind-inference=false -inline -functionattrs -indvars < %s | FileCheck %s
; RUN: opt -S -disable-nounwind-inference=false -inline -function-attrs -indvars < %s | FileCheck %s
; Check that the invalidation happens correctly and the test does not crash.
define void @f2() {

View File

@ -2,7 +2,7 @@
; RUN: opt -S -inline -stats < %s 2>&1 | FileCheck %s
; CHECK: Number of functions inlined
; RUN: opt -S -inline -functionattrs -stats < %s 2>&1 | FileCheck -check-prefix=CHECK-FUNCTIONATTRS %s
; RUN: opt -S -inline -function-attrs -stats < %s 2>&1 | FileCheck -check-prefix=CHECK-FUNCTIONATTRS %s
; CHECK-FUNCTIONATTRS: Number of call sites deleted, not inlined
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -inline -instcombine -functionattrs | llvm-dis
; RUN: opt < %s -inline -instcombine -function-attrs | llvm-dis
;
; Check that nocapture attributes are added when run after an SCC pass.
; PR3520

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -basic-aa -instcombine -inline -functionattrs -licm -loop-unswitch -gvn -verify
; RUN: opt < %s -basic-aa -instcombine -inline -function-attrs -licm -loop-unswitch -gvn -verify
; PR12573
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"
target triple = "x86_64-apple-macosx10.7.0"

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -inline -functionattrs -reassociate -S | FileCheck %s
; RUN: opt < %s -inline -function-attrs -reassociate -S | FileCheck %s
; CHECK-NOT: func1
; CHECK-LABEL: main

View File

@ -1,4 +1,4 @@
; RUN: opt < %s -basic-aa -instcombine -inline -functionattrs -licm -simple-loop-unswitch -gvn -verify
; RUN: opt < %s -basic-aa -instcombine -inline -function-attrs -licm -simple-loop-unswitch -gvn -verify
; PR12573
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"
target triple = "x86_64-apple-macosx10.7.0"