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

            Bug ID: 21290
           Summary: FP intrinsics need to have fast-math-flags too
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Bitcode Writer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

http://llvm.org/docs/LangRef.html#fast-math-flags says that only some FP
instructions can have fast-math-flags (FMF). That's not good enough.

Voice of god: "In a world with LTO..."

We can end up with intrinsics that should have fast semantics inside a function
that doesn't. But because intrinsics don't have the same privilege of FMF that
instructions do, that info is lost.

The LTO case was apparently one of the design goals of FMF, but this was
overlooked.

Even without the LTO case, there's reason for intrinsics to have FMF. For
example, see http://reviews.llvm.org/D5787. In that case, we need to know that
the sqrt can be reassociated. But because there's no way to express that at the
IR-level, we have to use a function attribute.

There's also a big pile of potential libcall optimizations at the bottom of
SimplifyLibCalls.cpp. Some/all of those will need FMF checking.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to