[LLVMbugs] [Bug 17757] New: ExpandInlineAsm is brittle, and uses obsolete register dirflag

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 31 09:42:33 PDT 2013


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

            Bug ID: 17757
           Summary: ExpandInlineAsm is brittle, and uses obsolete register
                    dirflag
           Product: libraries
           Version: 3.2
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: chris at smowton.net
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11464
  --> http://llvm.org/bugs/attachment.cgi?id=11464&action=edit
Patch

X86TargetLowering::ExpandInlineAsm is supposed to raise inline assembly
functions that implement endianness swaps into llvm.bswap intrinsics. However
it only recognises the exact sequence emitted by Clang; Dragonegg (3.2) emits a
somewhat different sequence and thus doesn't get raised, inhibiting some
optimisations.

In particular, the existing function inspects the asm clobber list and expects
exactly "~{cc}", "~{dirflag}", "~{flags}", "~{fpsr}". However, GCC eliminated
{dirflag} as a seperate clobberable pseudo-register in 2006
[http://gcc.gnu.org/ml/gcc-patches/2006-12/msg00468.html], and at least in
gcc-4.6 emits some permutation of "~{cc}", "~{flags}", "~{fpsr}". The attached
patch makes the clobber testing less brittle to allow both dragonegg and clang
code to be raised appropriately.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131031/1dcc4f74/attachment.html>


More information about the llvm-bugs mailing list