-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 9018 |
| Version | 2.8 |
| OS | Linux |
Extended Description
http://llvm.org/docs/LangRef.html
says, that the allowed function attributes for 'call' are 'noreturn', 'nounwind', 'readonly' and 'readnone',
but it does not tell how these attributes interact with the ones given in the according 'declare'.
The description of function attributes says, that function attributes are attributes of the function - so how can function attributes be part of a function call?
Is there a difference between
define double @arith(double, double) {
_L1:
%2 = call double @llvm.sin.f64(double %0)
%3 = call double @llvm.exp.f64(double %2)
%4 = fadd double %3, %1
ret double %4
}
declare double @llvm.sin.f64(double) readnone
declare double @llvm.exp.f64(double) readnone
and
define double @arith(double, double) {
_L1:
%2 = call double @llvm.sin.f64(double %0) readnone
%3 = call double @llvm.exp.f64(double %2) readnone
%4 = fadd double %3, %1
ret double %4
}
declare double @llvm.sin.f64(double)
declare double @llvm.exp.f64(double)
and
define double @arith(double, double) {
_L1:
%2 = call double @llvm.sin.f64(double %0) readnone
%3 = call double @llvm.exp.f64(double %2) readnone
%4 = fadd double %3, %1
ret double %4
}
declare double @llvm.sin.f64(double) readnone
declare double @llvm.exp.f64(double) readnone
?
I guess that the union of the sets of attributes of 'declare' and 'call' is considered when calling a function. If this is true, then the above functions should be equivalent.