Skip to content

Documentation of function attributes in a 'call' #9390

@thielema

Description

@thielema
mannequin
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilladocumentationllvmUmbrella label for LLVM issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions