1. Sep 29, 2014
    • Matt Arsenault's avatar
      R600/SI: Fix using mad with multiplies by 2 · 02cb0ff7
      Matt Arsenault authored
      These turn into fadds, so combine them into the target
      mad node.
      
      fadd (fadd (a, a), b) -> mad 2.0, a, b
      
      llvm-svn: 218608
      02cb0ff7
    • Chad Rosier's avatar
      [AArch64] Improve cost model to handle sdiv by a pow-of-two. · 70d54ac8
      Chad Rosier authored
      This patch improves the target-specific cost model to better handle signed
      division by a power of two. The immediate result is that this enables the SLP
      vectorizer to do a better job.
      
      http://reviews.llvm.org/D5469
      PR20714
      
      llvm-svn: 218607
      70d54ac8
    • Frederic Riss's avatar
      Store TypeUnits in a SmallVector<DWARFUnitSection> instead of a single DWARFUnitSection. · 312a02e1
      Frederic Riss authored
      There will be multiple TypeUnits in an unlinked object that will be extracted
      from different sections. Now that we have DWARFUnitSection that is supposed
      to represent an input section, we need a DWARFUnitSection<TypeUnit> per
      input .debug_types section.
      
      Once this is done, the interface is homogenous and we can move the Section
      parsing code into DWARFUnitSection.
      
      This is a respin of r218513 that got reverted because it broke some builders.
      This new version features an explicit move constructor for the DWARFUnitSection
      class to workaround compilers unable to generate correct C++11 default
      constructors.
      
      Reviewers: samsonov, dblaikie
      
      Subscribers: llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D5482
      
      llvm-svn: 218606
      312a02e1
    • Evgeniy Stepanov's avatar
      [sanitizer] Android build cleanup. · 9e922e7d
      Evgeniy Stepanov authored
      * Detect Android toolchain target arch and set correct runtime library name.
      * Merged a lot of Android and non-Android code paths.
      * Android is only supported in standalone build of compiler-rt now.
      * Linking lsan-common in ASan-Android (makes lsan annotations work).
      * Relying on -fsanitize=address linker flag when building tests (again,
        unification with non-Android path).
      * Runtime library moved from lib/asan to lib/linux.
      
      llvm-svn: 218605
      9e922e7d
    • Kevin Qin's avatar
      Use a loop to simplify the runtime unrolling prologue. · fc02e3c3
      Kevin Qin authored
      Runtime unrolling will create a prologue to execute the extra
      iterations which is can't divided by the unroll factor. It
      generates an if-then-else sequence to jump into a factor -1
      times unrolled loop body, like
      
          extraiters = tripcount % loopfactor
          if (extraiters == 0) jump Loop:
          if (extraiters == loopfactor) jump L1
          if (extraiters == loopfactor-1) jump L2
          ...
          L1:  LoopBody;
          L2:  LoopBody;
          ...
          if tripcount < loopfactor jump End
          Loop:
          ...
          End:
      
      It means if the unroll factor is 4, the loop body will be 7
      times unrolled, 3 are in loop prologue, and 4 are in the loop.
      This commit is to use a loop to execute the extra iterations
      in prologue, like
      
              extraiters = tripcount % loopfactor
              if (extraiters == 0) jump Loop:
              else jump Prol
       Prol:  LoopBody;
              extraiters -= 1                 // Omitted if unroll factor is 2.
              if (extraiters != 0) jump Prol: // Omitted if unroll factor is 2.
              if (tripcount < loopfactor) jump End
       Loop:
       ...
       End:
      
      Then when unroll factor is 4, the loop body will be copied by
      only 5 times, 1 in the prologue loop, 4 in the original loop.
      And if the unroll factor is 2, new loop won't be created, just
      as the original solution.
      
      llvm-svn: 218604
      fc02e3c3
    • Oliver Stannard's avatar
      [Thumb2] ldrexd and strexd are not defined on v7M · a4eba5ad
      Oliver Stannard authored
      The Thumb2 ldrexd and strexd instructions are not defined for
      M-class architectures.
      
      llvm-svn: 218603
      a4eba5ad
    • Alexey Bataev's avatar
      Fix bug 20116 - http://llvm.org/bugs/show_bug.cgi?id=20116 · 5bd68794
      Alexey Bataev authored
      Fixes incorrect codegen when devirtualization is aborted due to covariant return types.
      
      Differential Revision: http://reviews.llvm.org/D5321
      
      llvm-svn: 218602
      5bd68794
    • Oliver Stannard's avatar
      [compiler-rt] Do not use ldrexd or strexd on v7M · 609e2e6a
      Oliver Stannard authored
      The ldrexd and strexd instructions are undefined for the ARMv7M
      architecture, so we cannot use them to implement the
      __sync_fetch_and_*_8 builtins. There is no other way to implement
      these without OS support, so this patch #ifdef's these functions out
      for M-class architectures.
      
      There are no tests as I cannot find any existing tests for these
      builtins.
      
      I used the __ARM_ARCH_PROFILE predefine because __ARM_FEATURE_LDREX is
      deprecated and not set by clang.
      
      llvm-svn: 218601
      609e2e6a
    • Chandler Carruth's avatar
      [x86] Make the new vector shuffle lowering lower blends as VSELECT · 6cbf4316
      Chandler Carruth authored
      nodes, and rely exclusively on its logic. This removes a ton of
      duplication from the blend lowering and centralizes it in one place.
      
      One downside is that it requires a bunch of hacks to make this work with
      the current legalization framework. We have to manually speculate one
      aspect of legalizing VSELECT nodes to get everything to work nicely
      because the existing legalization framework isn't *actually* bottom-up.
      
      The other grossness is that we somewhat duplicate the analysis of
      constant blends. I'm on the fence here. If reviewers thing this would
      look better with VSELECT when it has constant operands dumping over tho
      VECTOR_SHUFFLE, we could go that way. But it would be a substantial
      change because currently all of the actual blend instructions are
      matched via patterns in the TD files based around VSELECT nodes (despite
      them not being perfect fits for that). Suggestions welcome, but at least
      this removes the rampant duplication in the backend.
      
      llvm-svn: 218600
      6cbf4316
    • Evgeniy Stepanov's avatar
      [asan] Fix SELinux setup on Android-K. · 3f11c0d7
      Evgeniy Stepanov authored
      On pre-L devices SELinux is set up in such a way that zygote wrapper
      has to be in system_file context, not zygote_exec.
      
      llvm-svn: 218599
      3f11c0d7
    • Daniel Jasper's avatar
      clang-format: Fix GCC warning about implicit bool pointer conversion. · 91881d99
      Daniel Jasper authored
      Introduced in r217880.
      
      llvm-svn: 218597
      91881d99
    • Matthew Gardiner's avatar
      Very minimal support 24-bit kalimbas. Vanilla "memory read" for data sections · f03e6d84
      Matthew Gardiner authored
      works, as do breakpoints, run and pause, display zeroth frame.
      
      See
      http://reviews.llvm.org/D5503
      
      for a fuller description of the changes in this commit.
      
      llvm-svn: 218596
      f03e6d84
    • Daniel Jasper's avatar
      clang-format: [JS] Improve formatting of function literals in chains · 1779d438
      Daniel Jasper authored
      Before:
        getSomeLongPromise(.....)
            .then(
                 function(value) {
                   body();
                   body();
                 })
            .thenCatch(function(error) {
          body();
          body();
        });
      
      After:
        getSomeLongPromise(.....)
            .then(function(value) {
              body();
              body();
            })
            .thenCatch(function(error) {
              body();
              body();
            });
      
      llvm-svn: 218595
      1779d438
    • Matthew Gardiner's avatar
      Included cstdarg for compilation of va_start and va_end. · e598d7b0
      Matthew Gardiner authored
      llvm-svn: 218594
      e598d7b0
    • Jyoti Allur's avatar
      Remove dead code from DIBuilder · b76b57fe
      Jyoti Allur authored
      llvm-svn: 218593
      b76b57fe
    • Jyoti Allur's avatar
      testing commit access to clang repo · 7d9f67f7
      Jyoti Allur authored
      llvm-svn: 218592
      7d9f67f7
    • Richard Smith's avatar
      Tests for DR600-640. · 31563ef0
      Richard Smith authored
      llvm-svn: 218591
      31563ef0
    • Richard Smith's avatar
    • Chandler Carruth's avatar
      [x86] Delete a bunch of really bad and totally unnecessary code in the · b1cc7a85
      Chandler Carruth authored
      X86 target-specific DAG combining that tried to convert VSELECT nodes
      into VECTOR_SHUFFLE nodes that it "knew" would lower into
      immediate-controlled blend nodes.
      
      Turns out, we have perfectly good lowering of all these VSELECT nodes,
      and indeed that lowering already knows how to handle lowering through
      BLENDI to immediate-controlled blend nodes. The code just wasn't getting
      used much because this thing forced the world to go through the vector
      shuffle lowering. Yuck.
      
      This also exposes that I was too aggressive in avoiding domain crossing
      in v218588 with that lowering -- when the other option is to expand into
      two 128-bit vectors, it is worth domain crossing. Restore that behavior
      now that we have nice tests covering it.
      
      The test updates here fall into two camps. One is where previously we
      ended up with an unsigned encoding of the blend operand and now we get
      a signed encoding. In most of those places there were elaborate comments
      explaining exactly what these operands really mean. Rather than that,
      just switch these tests to use the nicely decoded comments that make it
      obvious that the final shuffle matches.
      
      The other updates are just removing pointless domain crossing by
      blending integers with PBLENDW rather than BLENDPS.
      
      llvm-svn: 218589
      b1cc7a85
    • Chandler Carruth's avatar
      [x86] Refactor all of the VSELECT-as-blend lowering code to avoid domain · d639c7a8
      Chandler Carruth authored
      crossing and generally work more like the blend emission code in the new
      vector shuffle lowering.
      
      My goal is to have the new vector shuffle lowering just produce VSELECT
      nodes that are either matched here to BLENDI or are legal and matched in
      the .td files to specific blend instructions. That seems much cleaner as
      there are other ways to produce a VSELECT anyways. =]
      
      No *observable* functionality changed yet, mostly because this code
      appears to be near-dead. The behavior of this lowering routine did
      change though. This code being mostly dead and untestable will change
      with my next commit which will also point some new tests at it.
      
      llvm-svn: 218588
      d639c7a8
    • Nikola Smiljanic's avatar
      2f32527b
    • Chandler Carruth's avatar
      [x86] Improve naming and comments for VSELECT lowering. · 2f9e56e5
      Chandler Carruth authored
      No functionality changed.
      
      llvm-svn: 218586
      2f9e56e5
    • Chandler Carruth's avatar
      [x86] Add the dispatch skeleton to the new vector shuffle lowering for · c7129276
      Chandler Carruth authored
      AVX-512.
      
      There is no interesting logic yet. Everything ends up eventually
      delegating to the generic code to split the vector and shuffle the
      halves. Interestingly, that logic does a significantly better job of
      lowering all of these types than the generic vector expansion code does.
      Mostly, it lets most of the cases fall back to nice AVX2 code rather
      than all the way back to SSE code paths.
      
      Step 2 of basic AVX-512 support in the new vector shuffle lowering. Next
      up will be to incrementally add direct support for the basic instruction
      set to each type (adding tests first).
      
      llvm-svn: 218585
      c7129276
    • Chandler Carruth's avatar
      [x86] Make the split-and-lower routine fully generic by relaxing the · 32a3ebda
      Chandler Carruth authored
      assertion, making the name generic, and improving the documentation.
      
      Step 1 in adding very primitive support for AVX-512. No functionality
      changed yet.
      
      llvm-svn: 218584
      32a3ebda
    • Chandler Carruth's avatar
      [x86] Teach the new vector shuffle lowering to fall back on AVX-512 · 24e3b69c
      Chandler Carruth authored
      vectors.
      
      Someone will need to build the AVX512 lowering, which should follow
      AVX1 and AVX2 *very* closely for AVX512F and AVX512BW resp. I've added
      a dummy test which is a port of the v8f32 and v8i32 tests from AVX and
      AVX2 to v8f64 and v8i64 tests for AVX512F and AVX512BW. Hopefully this
      is enough information for someone to implement proper lowering here. If
      not, I'll be happy to help, but right now the AVX-512 support isn't
      a priority for me.
      
      llvm-svn: 218583
      24e3b69c
    • Chandler Carruth's avatar
      [x86] Fix the new vector shuffle lowering's use of VSELECT for AVX2 · abe742e8
      Chandler Carruth authored
      lowerings.
      
      This was hopelessly broken. First, the x86 backend wants '-1' to be the
      element value representing true in a boolean vector, and second the
      operand order for VSELECT is backwards from the actual x86 instructions.
      To make matters worse, the backend is just using '-1' as the true value
      to get the high bit to be set. It doesn't actually symbolically map the
      '-1' to anything. But on x86 this isn't quite how it works: there *only*
      the high bit is relevant. As a consequence weird non-'-1' values like
      0x80 actually "work" once you flip the operands to be backwards.
      
      Anyways, thanks to Hal for helping me sort out what these *should* be.
      
      llvm-svn: 218582
      abe742e8
    • Tobias Grosser's avatar
      Build domtree of new loops correctly · f8a678d2
      Tobias Grosser authored
      This fixes a bug introduced in r217525.
      
      llvm-svn: 218581
      f8a678d2
    • Richard Smith's avatar
      Run DR tests in C++17 mode too. · 09c07780
      Richard Smith authored
      llvm-svn: 218580
      09c07780
    • Matt Arsenault's avatar
      Add MachineOperand::ChangeToFPImmediate and setFPImm · 93ffe58f
      Matt Arsenault authored
      llvm-svn: 218579
      93ffe58f
  2. Sep 28, 2014