This implies annotating it as nounwind and its arguments as nocapture. To be
conservative, we do not annotate the arguments with noalias since some platforms
do not have restrict on the declaration for gettimeofday.
llvm-svn: 185502
// May throw; "open" is a valid pthread cancellation point.
setDoesNotCapture(F, 1);
break;
+ case LibFunc::gettimeofday:
+ if (FTy->getNumParams() != 2 || !FTy->getParamType(0)->isPointerTy() ||
+ !FTy->getParamType(1)->isPointerTy())
+ return false;
+ // Currently some platforms have the restrict keyword on the arguments to
+ // gettimeofday. To be conservative, do not add noalias to gettimeofday's
+ // arguments.
+ setDoesNotThrow(F);
+ setDoesNotCapture(F, 1);
+ setDoesNotCapture(F, 2);
default:
// Didn't mark any attributes.
return false;
declare i32 @strcpy(...)
; CHECK: declare i32 @strcpy(...)
+declare i32 @gettimeofday(i8*, i8*)
+; CHECK: declare i32 @gettimeofday(i8* nocapture, i8* nocapture) [[G0]]
+
; CHECK: attributes [[G0]] = { nounwind }
; CHECK: attributes [[G1]] = { nounwind readonly }