[LLVMbugs] [Bug 2141] New: Could raise libcalls to intrinsics using parameter attributes

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Mar 12 04:19:04 PDT 2008


http://llvm.org/bugs/show_bug.cgi?id=2141

           Summary: Could raise libcalls to intrinsics using parameter
                    attributes
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


The simplify libcalls pass could automatically turn a
call to @sin into a call to llvm.sin by checking the
profile and (this is the important bit which was lacking
before) that the call has the "readnone" attribute set.
The attribute needs to be checked because llvm.sin has
this attribute, and the @sin call might set errno or
use the rounding mode (in which case it will usually
be marked readonly).  Similarly for a bunch of other
functions which have LLVM intrinsic equivalents.  In
general I suppose the transform could be done if the
libcall has at least all the same attributes as the
intrinsic.

That said, it's not completely clear that it makes
sense to do this - what does using the intrinsic buy
us?  I guess it could simplify some code.  Also, I
notice that codegen turns any function called @sin
into a SIN node (and presumably into a processor sin
instruction if it has one).  This seems bogus since
it ignores all these issues about errno and rounding
modes, and whether @sin should be identified with the
sin function at all, etc.  However if the proposed
transform was implemented then codegen could just
convert llvm.sin, and know that any @sin function
will already have been turned into llvm.sin if that
is valid.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list