[llvm] r267760 - [InferAttrs] Mark memset_pattern16 params nocapture.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 12:04:44 PDT 2016


Author: ab
Date: Wed Apr 27 14:04:43 2016
New Revision: 267760

URL: http://llvm.org/viewvc/llvm-project?rev=267760&view=rev
Log:
[InferAttrs] Mark memset_pattern16 params nocapture.

Differential Revision: http://reviews.llvm.org/D19471

Modified:
    llvm/trunk/lib/Transforms/Utils/BuildLibCalls.cpp
    llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll

Modified: llvm/trunk/lib/Transforms/Utils/BuildLibCalls.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/BuildLibCalls.cpp?rev=267760&r1=267759&r2=267760&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/BuildLibCalls.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/BuildLibCalls.cpp Wed Apr 27 14:04:43 2016
@@ -690,6 +690,8 @@ bool llvm::inferLibFuncAttributes(Functi
   //case LibFunc::memset_pattern8:
   case LibFunc::memset_pattern16:
     Changed |= setOnlyAccessesArgMemory(F);
+    Changed |= setDoesNotCapture(F, 1);
+    Changed |= setDoesNotCapture(F, 2);
     Changed |= setOnlyReadsMemory(F, 2);
     return Changed;
   // int __nvvm_reflect(const char *)

Modified: llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll?rev=267760&r1=267759&r2=267760&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll (original)
+++ llvm/trunk/test/Transforms/InferFunctionAttrs/annotate.ll Wed Apr 27 14:04:43 2016
@@ -25,7 +25,7 @@ declare i8* @_Znwm(i64)
 
 declare void @memset_pattern16(i8*, i8*, i64)
 ; CHECK: declare void @memset_pattern16(i8*, i8*, i64)
-; CHECK-POSIX: declare void @memset_pattern16(i8*, i8* readonly, i64) [[G2:#[0-9]+]]
+; CHECK-POSIX: declare void @memset_pattern16(i8* nocapture, i8* nocapture readonly, i64) [[G2:#[0-9]+]]
 
 declare i32 @gettimeofday(i8*, i8*)
 ; CHECK-POSIX: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0:#[0-9]+]]




More information about the llvm-commits mailing list