Skip to content
  1. Oct 23, 2012
  2. Oct 19, 2012
    • Shuxin Yang's avatar
      This patch is to fix radar://8426430. It is about llvm support of __builtin_debugtrap() · cdde059a
      Shuxin Yang authored
      which is supposed to consistently raise SIGTRAP across all systems. In contrast,
      __builtin_trap() behave differently on different systems. e.g. it raises SIGTRAP on ARM, and
      SIGILL on X86. The purpose of __builtin_debugtrap() is to consistently provide "trap"
      functionality, in the mean time preserve the compatibility with on gcc on __builtin_trap().
      
        The X86 backend is already able to handle debugtrap(). This patch is to:
        1) make front-end recognize "__builtin_debugtrap()" (emboddied in the one-line change to Clang).
        2) In DAG legalization phase, by default, "debugtrap" will be replaced with "trap", which
           make the __builtin_debugtrap() "available" to all existing ports without the hassle of
           changing their code.
        3) If trap-function is specified (via -trap-func=xyz to llc), both __builtin_debugtrap() and
           __builtin_trap() will be expanded into the function call of the specified trap function.
          This behavior may need change in the future.
      
        The provided testing-case is to make sure 2) and 3) are working for ARM port, and we
      already have a testing case for x86. 
      
      llvm-svn: 166300
      cdde059a
    • Michael Liao's avatar
      Lower BUILD_VECTOR to SHUFFLE + INSERT_VECTOR_ELT for X86 · 4b7ccfca
      Michael Liao authored
      - If INSERT_VECTOR_ELT is supported (above SSE2, either by custom
        sequence of legal insn), transform BUILD_VECTOR into SHUFFLE +
        INSERT_VECTOR_ELT if most of elements could be built from SHUFFLE with few
        (so far 1) elements being inserted.
      
      llvm-svn: 166288
      4b7ccfca
  3. Oct 17, 2012
  4. Oct 16, 2012
    • Michael Liao's avatar
      Support v8f32 to v8i8/vi816 conversion through custom lowering · 02ca3454
      Michael Liao authored
      - Add custom FP_TO_SINT on v8i16 (and v8i8 which is legalized as v8i16 due to
        vector element-wise widening) to reduce DAG combiner and its overhead added
        in X86 backend.
      
      llvm-svn: 166036
      02ca3454
    • NAKAMURA Takumi's avatar
      Reapply r165661, Patch by Shuxin Yang <shuxin.llvm@gmail.com>. · 1705a999
      NAKAMURA Takumi authored
      Original message:
      
      The attached is the fix to radar://11663049. The optimization can be outlined by following rules:
      
         (select (x != c), e, c) -> select (x != c), e, x),
         (select (x == c), c, e) -> select (x == c), x, e)
      where the <c> is an integer constant.
      
       The reason for this change is that : on x86, conditional-move-from-constant needs two instructions;
      however, conditional-move-from-register need only one instruction.
      
        While the LowerSELECT() sounds to be the most convenient place for this optimization, it turns out to be a bad place. The reason is that by replacing the constant <c> with a symbolic value, it obscure some instruction-combining opportunities which would otherwise be very easy to spot. For that reason, I have to postpone the change to last instruction-combining phase.
      
        The change passes the test of "make check-all -C <build-root/test" and "make -C project/test-suite/SingleSource".
      
      Original message since r165661:
      
      My previous change has a bug: I negated the condition code of a CMOV, and go ahead creating a new CMOV using the *ORIGINAL* condition code.
      
      llvm-svn: 166017
      1705a999
    • Michael Liao's avatar
      Add __builtin_setjmp/_longjmp supprt in X86 backend · 97bf363a
      Michael Liao authored
      - Besides used in SjLj exception handling, __builtin_setjmp/__longjmp is also
        used as a light-weight replacement of setjmp/longjmp which are used to
        implementation continuation, user-level threading, and etc. The support added
        in this patch ONLY addresses this usage and is NOT intended to support SjLj
        exception handling as zero-cost DWARF exception handling is used by default
        in X86.
      
      llvm-svn: 165989
      97bf363a
  5. Oct 15, 2012
  6. Oct 13, 2012
  7. Oct 11, 2012
  8. Oct 10, 2012
    • Nadav Rotem's avatar
      Patch by Shuxin Yang <shuxin.llvm@gmail.com>. · 17418964
      Nadav Rotem authored
      Original message:
      
      The attached is the fix to radar://11663049. The optimization can be outlined by following rules:
      
         (select (x != c), e, c) -> select (x != c), e, x),
         (select (x == c), c, e) -> select (x == c), x, e)
      where the <c> is an integer constant.
      
       The reason for this change is that : on x86, conditional-move-from-constant needs two instructions;
      however, conditional-move-from-register need only one instruction.
      
        While the LowerSELECT() sounds to be the most convenient place for this optimization, it turns out to be a bad place. The reason is that by replacing the constant <c> with a symbolic value, it obscure some instruction-combining opportunities which would otherwise be very easy to spot. For that reason, I have to postpone the change to last instruction-combining phase.
      
        The change passes the test of "make check-all -C <build-root/test" and "make -C project/test-suite/SingleSource".
      
      llvm-svn: 165661
      17418964
    • Michael Liao's avatar
      Add support for FP_ROUND from v2f64 to v2f32 · e999b865
      Michael Liao authored
      - Due to the current matching vector elements constraints in
        ISD::FP_ROUND, rounding from v2f64 to v4f32 (after legalization from
        v2f32) is scalarized. Add a customized v2f32 widening to convert it
        into a target-specific X86ISD::VFPROUND to work around this
        constraints.
      
      llvm-svn: 165631
      e999b865
    • Michael Liao's avatar
      Add alternative support for FP_ROUND from v2f32 to v2f64 · effae0c8
      Michael Liao authored
      - Due to the current matching vector elements constraints in ISD::FP_EXTEND,
        rounding from v2f32 to v2f64 is scalarized. Add a customized v2f32 widening
        to convert it into a target-specific X86ISD::VFPEXT to work around this
        constraints. This patch also reverts a previous attempt to fix this issue by
        recovering the scalarized ISD::FP_EXTEND pattern and thus significantly
        reduces the overhead of supporting non-power-2 vector FP extend.
      
      llvm-svn: 165625
      effae0c8
    • Evan Cheng's avatar
  9. Oct 09, 2012
  10. Oct 08, 2012
  11. Oct 04, 2012
  12. Sep 30, 2012
  13. Sep 26, 2012
  14. Sep 25, 2012
  15. Sep 21, 2012
  16. Sep 20, 2012
    • Michael Liao's avatar
      Re-work X86 code generation of atomic ops with spin-loop · 3237662b
      Michael Liao authored
      - Rewrite/merge pseudo-atomic instruction emitters to address the
        following issue:
        * Reduce one unnecessary load in spin-loop
      
          previously the spin-loop looks like
      
              thisMBB:
              newMBB:
                ld  t1 = [bitinstr.addr]
                op  t2 = t1, [bitinstr.val]
                not t3 = t2  (if Invert)
                mov EAX = t1
                lcs dest = [bitinstr.addr], t3  [EAX is implicit]
                bz  newMBB
                fallthrough -->nextMBB
      
          the 'ld' at the beginning of newMBB should be lift out of the loop
          as lcs (or CMPXCHG on x86) will load the current memory value into
          EAX. This loop is refined as:
      
              thisMBB:
                EAX = LOAD [MI.addr]
              mainMBB:
                t1 = OP [MI.val], EAX
                LCMPXCHG [MI.addr], t1, [EAX is implicitly used & defined]
                JNE mainMBB
              sinkMBB:
      
        * Remove immopc as, so far, all pseudo-atomic instructions has
          all-register form only, there is no immedidate operand.
      
        * Remove unnecessary attributes/modifiers in pseudo-atomic instruction
          td
      
        * Fix issues in PR13458
      
      - Add comprehensive tests on atomic ops on various data types.
        NOTE: Some of them are turned off due to missing functionality.
      
      - Revise tests due to the new spin-loop generated.
      
      llvm-svn: 164281
      3237662b
  17. Sep 15, 2012
  18. Sep 13, 2012
  19. Sep 12, 2012
    • Michael Liao's avatar
      Fix PR11985 · abb87d48
      Michael Liao authored
          
      - BlockAddress has no support of BA + offset form and there is no way to
        propagate that offset into machine operand;
      - Add BA + offset support and a new interface 'getTargetBlockAddress' to
        simplify target block address forming;
      - All targets are modified to use new interface and X86 backend is enhanced to
        support BA + offset addressing.
      
      llvm-svn: 163743
      abb87d48
    • Craig Topper's avatar
      Indentation fixes. No functional change. · ad495964
      Craig Topper authored
      llvm-svn: 163682
      ad495964
Loading