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

            Bug ID: 16711
           Summary: Multiple identical floating point constants emitted.
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

clang -O3 emits two copies of the constant `42.0f` for this code:
float user1(float F) {
  return F * 42.0f;
}
float user2(float F) {
  return F * 42.0f;
}

output:

[...]
LCPI0_0:
        .long   1109917696              ## float 42
[...]
        mulss   LCPI0_0(%rip), %xmm0
[...]
LCPI1_0:
        .long   1109917696              ## float 42
[...]
        mulss   LCPI1_0(%rip), %xmm0
[...]

For 3 functions, 3 copies of the constant are emitted, etc. The constants ought
to be uniqued.

`-arch armv7` also seems to experience the same issue.

-- 
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