Skip to content
  1. Oct 17, 2013
    • Anders Waldenborg's avatar
      llvm-c: Don't assert in LLVMTargetMachineEmitToFile on nonexistent file · 39f5d7d5
      Anders Waldenborg authored
      Error handling code for raw_fd_ostream constructor is present, but
      never used, because formatted_raw_ostream will always assert on closed
      fd's before.
      
      Patch by Peter Zotov
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1909
      
      llvm-svn: 192881
      39f5d7d5
    • Daniel Sanders's avatar
      [mips][msa] Correct definition order of ftrunc_[su], ftint_[su], and ftq. · 199b731b
      Daniel Sanders authored
      Define these three instructions in alphabetical order (like the rest of the
      file).
      No functional change.
      
      llvm-svn: 192880
      199b731b
    • Anders Waldenborg's avatar
      llvm-c: Return NULL from LLVMGetFirstTarget instead of asserting · a89c1e31
      Anders Waldenborg authored
      If no targets are registered, LLVMGetFirstTarget currently fails with
      an assertion. This patch makes it return NULL instead, similarly to
      how LLVMGetNextTarget would.
      
      Patch by Peter Zotov
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1908
      
      llvm-svn: 192878
      a89c1e31
    • Jim Grosbach's avatar
      x86: Move bitcasts outside concat_vector. · c044c654
      Jim Grosbach authored
      Consider the following:
      
      typedef unsigned short ushort4U __attribute__((ext_vector_type(4),
      aligned(2)));
      typedef unsigned short ushort4 __attribute__((ext_vector_type(4)));
      typedef unsigned short ushort8 __attribute__((ext_vector_type(8)));
      typedef int int4 __attribute__((ext_vector_type(4)));
      
      int4 __bbase_cvt_int(ushort4 v) {
        ushort8 a;
        a.lo = v;
        return _mm_cvtepu16_epi32(a);
      }
      
      This generates the, not unreasonable, IR:
      define <4 x i32> @foo0(double %v.coerce) nounwind ssp {
        %tmp = bitcast double %v.coerce to <4 x i16>
        %tmp1 = shufflevector <4 x i16> %tmp, <4 x i16> undef, <8 x i32> <i32
        %0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef>
        %tmp2 = tail call <4 x i32> @llvm.x86.sse41.pmovzxwd(<8 x i16> %tmp1)
        ret <4 x i32> %tmp2
      }
      
      The problem is when type legalization gets hold of the v4i16. It
      legalizes that by spilling to the stack, then doing a zero-extending
      load. Things go even more silly from there, ending up with something
      like:
      _foo0:
        movsd %xmm0, -8(%rsp)       <== Spill to the stack.
        movq  -8(%rsp), %xmm0       <== Reload it right back out.
        pmovzxwd  %xmm0, %xmm1      <== Here's what we actually asked for.
        pblendw $1, %xmm1, %xmm0    <== We don't need this at all
        pmovzxwd  %xmm0, %xmm0      <== We already did this
        ret
      
      The v8i8 to v8i16 zext intrinsic gives even worse results, with two
      table lookups via pshufb instructions(!!).
      
      To avoid all that, we can move the bitcasting until after we've formed
      the wider (legal) vector type. Then our normal codegen flows along
      nicely and we get the expected:
      _foo0:
        pmovzxwd  %xmm0, %xmm0
        ret
      
      rdar://15245794
      
      llvm-svn: 192866
      c044c654
    • Hans Wennborg's avatar
      Re-commit r192758 - MC: quote tricky symbol names in asm output · 69918bcc
      Hans Wennborg authored
      The reason this got reverted was that the @feat.00 symbol which was emitted
      for every TU became quoted, and on cygwin/mingw we use the gas assembler which
      couldn't handle the quotes.
      
      This commit fixes the problem by only emitting @feat.00 for win32, where we use
      clang -cc1as to assemble. gas would just drop this symbol anyway, so there is no
      loss there.
      
      With @feat.00 gone, there shouldn't be quoted symbols showing up on cygwin since
      it uses the Itanium ABI, which doesn't put these funny characters in symbols.
      
      > Because of win32 mangling, we produce symbol and section names with
      > funny characters in them, most notably @ characters.
      >
      > MC would choke on trying to parse its own assembly output. This patch addresses
      > that by:
      >
      > - Making @ trigger quoting of symbol names
      > - Also quote section names in the same way
      > - Just parse section names like other identifiers (to allow for quotes)
      > - Don't assume @ signifies a symbol variant if it is in a string.
      
      llvm-svn: 192859
      69918bcc
  2. Oct 16, 2013
  3. Oct 15, 2013
Loading