[llvm] baa51a0 - [Tests] Add missing willreturn attributes (NFC)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 24 08:28:55 PDT 2021


Author: Nikita Popov
Date: 2021-07-24T17:17:48+02:00
New Revision: baa51a0cef57587cfbea4fc437a7968b6daf0290

URL: https://github.com/llvm/llvm-project/commit/baa51a0cef57587cfbea4fc437a7968b6daf0290
DIFF: https://github.com/llvm/llvm-project/commit/baa51a0cef57587cfbea4fc437a7968b6daf0290.diff

LOG: [Tests] Add missing willreturn attributes (NFC)

To retain the spirit of these tests after an upcoming change
to mayHaveSideEffect(), add willreturn attributes to a number
of functions.

Added: 
    

Modified: 
    llvm/test/Transforms/LICM/funclet.ll
    llvm/test/Transforms/LICM/sinking.ll
    llvm/test/Transforms/SCCP/calltest.ll
    llvm/test/Transforms/SCCP/musttail-call.ll
    llvm/test/Transforms/SCCP/remove-call-inst.ll
    llvm/test/Transforms/TailCallElim/reorder_load.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/LICM/funclet.ll b/llvm/test/Transforms/LICM/funclet.ll
index 05c23435964bc..a8bba96f74dc9 100644
--- a/llvm/test/Transforms/LICM/funclet.ll
+++ b/llvm/test/Transforms/LICM/funclet.ll
@@ -157,6 +157,6 @@ else:                                             ; preds = %postinvoke
 
 declare void @may_throw()
 
-declare i32 @pure_computation() nounwind argmemonly readonly
+declare i32 @pure_computation() nounwind argmemonly readonly willreturn
 
 declare i32 @__CxxFrameHandler3(...)

diff  --git a/llvm/test/Transforms/LICM/sinking.ll b/llvm/test/Transforms/LICM/sinking.ll
index da5ab04c5a13a..a9c0f45627a4e 100644
--- a/llvm/test/Transforms/LICM/sinking.ll
+++ b/llvm/test/Transforms/LICM/sinking.ll
@@ -3,7 +3,7 @@
 ; RUN: opt < %s -basic-aa -licm -S -enable-mssa-loop-dependency=true -verify-memoryssa | FileCheck %s
 
 
-declare i32 @strlen(i8*) readonly nounwind
+declare i32 @strlen(i8*) readonly nounwind willreturn
 
 declare void @foo()
 
@@ -27,7 +27,7 @@ Out:		; preds = %Loop
   ret i32 %A
 }
 
-declare double @sin(double) readnone nounwind
+declare double @sin(double) readnone nounwind willreturn
 
 ; Sink readnone function out of loop with unknown memory behavior.
 define double @test2(double %X) {

diff  --git a/llvm/test/Transforms/SCCP/calltest.ll b/llvm/test/Transforms/SCCP/calltest.ll
index 2ba46c02f1f28..cf43ea2caa587 100644
--- a/llvm/test/Transforms/SCCP/calltest.ll
+++ b/llvm/test/Transforms/SCCP/calltest.ll
@@ -1,7 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
 ; RUN: opt < %s -sccp -loop-deletion -simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
 
-declare double @sqrt(double) readnone nounwind
+declare double @sqrt(double) readnone nounwind willreturn
 %empty = type {}
 declare %empty @has_side_effects()
 

diff  --git a/llvm/test/Transforms/SCCP/musttail-call.ll b/llvm/test/Transforms/SCCP/musttail-call.ll
index 468f72627630e..cc2f14d807f7c 100644
--- a/llvm/test/Transforms/SCCP/musttail-call.ll
+++ b/llvm/test/Transforms/SCCP/musttail-call.ll
@@ -59,7 +59,7 @@ define internal i8* @side_effects(i8 %v) {
 }
 
 ; The call to this function is removed, so the return value must be zapped
-define internal i8* @no_side_effects(i8 %v) readonly nounwind {
+define internal i8* @no_side_effects(i8 %v) readonly nounwind willreturn {
 ; CHECK-LABEL: define {{[^@]+}}@no_side_effects
 ; CHECK-SAME: (i8 [[V:%.*]]) #[[ATTR0:[0-9]+]] {
 ; CHECK-NEXT:    ret i8* undef

diff  --git a/llvm/test/Transforms/SCCP/remove-call-inst.ll b/llvm/test/Transforms/SCCP/remove-call-inst.ll
index 9ab2289d7c811..081999acae8c3 100644
--- a/llvm/test/Transforms/SCCP/remove-call-inst.ll
+++ b/llvm/test/Transforms/SCCP/remove-call-inst.ll
@@ -15,7 +15,7 @@ entry:
   ret i32 %call2
 }
 
-define internal i32 @wwrite(i64 %i) nounwind readnone {
+define internal i32 @wwrite(i64 %i) nounwind readnone willreturn {
 ; CHECK-LABEL: @wwrite(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[SW_DEFAULT:%.*]]
@@ -36,4 +36,4 @@ return:
 }
 
 ; CHECK: attributes #0 = { noreturn nounwind }
-; CHECK: attributes #1 = { nounwind readnone }
+; CHECK: attributes #1 = { nounwind readnone willreturn }

diff  --git a/llvm/test/Transforms/TailCallElim/reorder_load.ll b/llvm/test/Transforms/TailCallElim/reorder_load.ll
index e535c9a6524ac..30341b78a29eb 100644
--- a/llvm/test/Transforms/TailCallElim/reorder_load.ll
+++ b/llvm/test/Transforms/TailCallElim/reorder_load.ll
@@ -15,7 +15,7 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 
 ; This load can be moved above the call because the function won't write to it
 ; and the call has no side effects.
-define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly {
+define fastcc i32 @raise_load_1(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
 ; CHECK-LABEL: @raise_load_1(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[TAILRECURSE:%.*]]
@@ -99,7 +99,7 @@ recurse:		; preds = %else
 
 ; This load can be safely moved above the call (even though it's from an
 ; extern_weak global) because the call has no side effects.
-define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly {
+define fastcc i32 @raise_load_3(i32* %a_arg, i32 %a_len_arg, i32 %start_arg) nounwind readonly willreturn {
 ; CHECK-LABEL: @raise_load_3(
 ; CHECK-NEXT:  entry:
 ; CHECK-NEXT:    br label [[TAILRECURSE:%.*]]


        


More information about the llvm-commits mailing list