1. Sep 21, 2014
    • Chandler Carruth's avatar
      [x86] Explicitly lower to a blend early if it is trivial to do so for · 3dccabaf
      Chandler Carruth authored
      v8f32 shuffles in the new vector shuffle lowering code.
      
      This is very cheap to do and makes it much more clear that anything more
      expensive but overlapping with this lowering should be selected
      afterward (for example using AVX2's VPERMPS). However, no functionality
      changed here as without this code we would fall through to create no-op
      shuffles of each input and a blend. =]
      
      llvm-svn: 218209
      3dccabaf
    • Chandler Carruth's avatar
      [x86] Teach the new vector shuffle lowering of v4f64 to prefer a direct · e81bfbad
      Chandler Carruth authored
      VBLENDPD over using VSHUFPD. While the 256-bit variant of VBLENDPD slows
      down to the same speed as VSHUFPD on Sandy Bridge CPUs, it has twice the
      reciprocal throughput on Ivy Bridge CPUs much like it does everywhere
      for 128-bits. There isn't a downside, so just eagerly use this
      instruction when it suffices.
      
      llvm-svn: 218208
      e81bfbad
    • Chandler Carruth's avatar
      [x86] Add some more comprehensive tests for v4f64 blending. · 6aea21df
      Chandler Carruth authored
      llvm-svn: 218207
      6aea21df
    • Chandler Carruth's avatar
      [x86] Re-generate a bunch of the v4f64 test cases with my new script. · 908afb56
      Chandler Carruth authored
      This expands the integer cases to cover the fact that AVX2 moves their
      lane-crossing shuffles into the integer domain. It also adds proper
      support for AVX2 run lines and the "ALL" group when it doesn't matter.
      
      llvm-svn: 218206
      908afb56
    • Chandler Carruth's avatar
      [x86] Switch the blend implementation to use a MVT switch rather than · 8d0a1b20
      Chandler Carruth authored
      awkward conditions. The readability improvement of this will be even
      more important as I generalize it to handle more types.
      
      No functionality changed.
      
      llvm-svn: 218205
      8d0a1b20
    • Chandler Carruth's avatar
      [x86] Remove some essentially lying comments from the v4f64 path of the · f098cee2
      Chandler Carruth authored
      new vector shuffle lowering.
      
      llvm-svn: 218204
      f098cee2
    • Chandler Carruth's avatar
      [x86] Fix a helper to reflect that what we actually care about is · a746d776
      Chandler Carruth authored
      128-bit lane crossings, not 'half' crossings. This came up in code
      review ages ago, but I hadn't really addresesd it. Also added some
      documentation for the helper.
      
      No functionality changed.
      
      llvm-svn: 218203
      a746d776
    • Chandler Carruth's avatar
      [x86] Teach the new vector shuffle lowering the first step toward more · 293327dd
      Chandler Carruth authored
      actual support for complex AVX shuffling tricks. We can do independent
      blends of the low and high 128-bit lanes of an avx vector, so shuffle
      the inputs into place and then do the blend at 256 bits. This will in
      many cases remove one blend instruction.
      
      The next step is to permute the low and high halves in-place rather than
      extracting them and re-inserting them.
      
      llvm-svn: 218202
      293327dd
    • David Majnemer's avatar
      MC: Support aligned COMMON symbols for COFF · 48227a37
      David Majnemer authored
      link.exe:
      Fuzz testing has shown that COMMON symbols with size > 32 will always
      have an alignment of at least 32 and all symbols with size < 32 will
      have an alignment of at least the largest power of 2 less than the size
      of the symbol.
      
      binutils:
      The BFD linker essentially work like the link.exe behavior but with
      alignment 4 instead of 32.  The BFD linker also supports an extension to
      COFF which adds an -aligncomm argument to the .drectve section which
      permits specifying a precise alignment for a variable but MC currently
      doesn't support editing .drectve in this way.
      
      With all of this in mind, we decide to play a little trick: we can
      ensure that the alignment will be respected by bumping the size of the
      global to it's alignment.
      
      llvm-svn: 218201
      48227a37
    • Chandler Carruth's avatar
      [x86] Add some more test cases covering specific blend patterns. · 8ff73c01
      Chandler Carruth authored
      llvm-svn: 218200
      8ff73c01
    • Chandler Carruth's avatar
      [x86] Add the beginnings of some tests for our v8f32 shuffle lowering · 7a6108d6
      Chandler Carruth authored
      under AVX.
      
      This really just documents the current state of the world. I'm going to
      try to flesh it out to cover any test cases I plan to improve prior to
      improving them so that the delta made by changes is actually visible to
      code reviewers.
      
      This is made easier by the fact that I now have a script to automate the
      process of producing test cases including the check lines. =]
      
      llvm-svn: 218199
      7a6108d6
    • Yaron Keren's avatar
      Modified per David Blakie suggestion. · 9682c855
      Yaron Keren authored
      llvm-svn: 218198
      9682c855
    • Yaron Keren's avatar
      Silence these C4715 warnings from Visual C++ (NFC) · 84f3816f
      Yaron Keren authored
      llvm\tools\lld\lib\readerwriter\macho\macholinkingcontext.cpp(647):
      warning C4715: 'lld::MachOLinkingContext::exportSymbolNamed' :
      not all control paths return a value
      
      llvm\tools\lld\lib\readerwriter\macho\machonormalizedfilefromatoms.cpp(723):
      warning C4715: '`anonymous namespace'::Util::getSymbolTableRegion' :
      not all control paths return a value
      
      While all enum values do appear in the switch, an uninitialized or corrupted
      enum variable would not be caught without the default: case in the switch.
      
      llvm-svn: 218197
      84f3816f
    • Ed Maste's avatar
      Enable libcxx map test on FreeBSD again · da7c5b25
      Ed Maste authored
      The test used to trigger an assertion failure "Cannot get layout of
      forward declarations!", but it no longer fails when built with
      Clang 3.4.1 (system compiler) or 3.5 from SVN on FreeBSD.
      
      llvm.org/pr17231
      
      llvm-svn: 218196
      da7c5b25
    • NAKAMURA Takumi's avatar
      RTDyldMemoryManager::getSymbolAddress(): Make sure to return 0 if symbol name... · 4b21bac5
      NAKAMURA Takumi authored
      RTDyldMemoryManager::getSymbolAddress(): Make sure to return 0 if symbol name is not met. [-Wreturn-type]
      
      llvm-svn: 218195
      4b21bac5
    • Sanjay Patel's avatar
    • Chandler Carruth's avatar
      [x86] Teach the new vector shuffle lowering to use VPERMILPD for · a454812a
      Chandler Carruth authored
      single-input shuffles with doubles. This allows them to fold memory
      operands into the shuffle, etc. This is just the analog to the v4f32
      case in my prior commit.
      
      llvm-svn: 218193
      a454812a
    • Chandler Carruth's avatar
      [x86] Add an AVX run to the 128-bit v2 tests, teach them to have · aa5b798a
      Chandler Carruth authored
      a generic SSE and AVX mode in addition to a specific AVX1 test path, and
      flesh out the AVX tests.
      
      llvm-svn: 218192
      aa5b798a
    • David Majnemer's avatar
      Update tests which broke from r218189 · fb839775
      David Majnemer authored
      llvm-svn: 218191
      fb839775
    • Chandler Carruth's avatar
      [x86] Teach the new vector shuffle lowering to use the AVX VPERMILPS · 6f80abac
      Chandler Carruth authored
      instruction for single-vector floating point shuffles. This in turn
      allows the shuffles to fold a load into the instruction which is one of
      the common regressions hit with the new shuffle lowering.
      
      llvm-svn: 218190
      6f80abac
    • David Majnemer's avatar
      MC: Fix MCSectionCOFF::PrintSwitchToSection · 7d0dc3ef
      David Majnemer authored
      We had a few bugs:
      - We were considering the GVKind instead of just looking at the section
        characteristics
      - We would never print out 'y' when a section was meant to be unreadable
      - We would never print out 's' when a section was meant to be shared
      - We translated IMAGE_SCN_MEM_DISCARDABLE to 'n' when it should've meant
        IMAGE_SCN_LNK_REMOVE
      
      llvm-svn: 218189
      7d0dc3ef
    • Chandler Carruth's avatar
      [x86] Start moving to a fancier check syntax to reduce the need for · 78a761ce
      Chandler Carruth authored
      duplication of check lines. The idea is to have broad sets of
      compilation modes that will frequently diverge without having to always
      and immediately explode to the precise ISA feature set.
      
      While this already helps due to VEX encoded differences, it will help
      much more as I teach the new shuffle lowering about more of the new VEX
      encoded instructions which can still be used to implement 128-bit
      shuffles.
      
      llvm-svn: 218188
      78a761ce
    • Lang Hames's avatar
      [MCJIT] Make RTDyldMemoryManager::getSymbolAddress's behaviour more consistent. · b7fbf593
      Lang Hames authored
      This patch modifies RTDyldMemoryManager::getSymbolAddress(Name)'s behavior to
      make it consistent with how clients are using it: Name should be mangled, and
      getSymbolAddress should demangle it on the caller's behalf before looking the
      name up in the process. This patch also fixes the one client
      (MCJIT::getPointerToFunction) that had been passing unmangled names (by having
      it pass mangled names instead).
      
      Background:
      
      RTDyldMemoryManager::getSymbolAddress(Name) has always used a re-try mechanism
      when looking up symbol names in the current process. Prior to this patch
      getSymbolAddress first tried to look up 'Name' exactly as the user passed it in
      and then, if that failed, tried to demangle 'Name' and re-try the look up. The
      implication of this behavior is that getSymbolAddress expected to be called with
      unmangled names, and that handling mangled names was a fallback for convenience.
      This is inconsistent with how clients (particularly the RuntimeDyldImpl
      subclasses, but also MCJIT) usually use this API. Most clients pass in mangled
      names, and succeed only because of the fallback case. For clients passing in
      mangled names, getSymbolAddress's old behavior was actually dangerous, as it
      could cause unmangled names in the process to shadow mangled names being looked
      up.
      
      For example, consider:
      
      foo.c:
      
      int _x = 7;
      int x() { return _x; }
      
      foo.o:
      
      000000000000000c D __x
      0000000000000000 T _x
      
      If foo.c becomes part of the process (E.g. via dlopen("libfoo.dylib")) it will
      add symbols 'x' (the function) and '_x' (the variable) to the process. However
      jit clients looking for the function 'x' will be using the mangled function name
      '_x' (note how function 'x' appears in foo.o). When getSymbolAddress goes
      looking for '_x' it will find the variable instead, and return its address and
      in place of the function, leading to JIT'd code calling the variable and
      crashing (if we're lucky).
      
      By requiring that getSymbolAddress be called with mangled names, and demangling
      only when we're about to do a lookup in the process, the new behavior
      implemented in this patch should eliminate any chance of names being shadowed
      during lookup.
      
      There's no good way to test this at the moment: This issue only arrises when
      looking up process symbols (not JIT'd symbols). Any test case would have to
      generate a platform-appropriate dylib to pass to llvm-rtdyld, and I'm not
      aware of any in-tree tool for doing this in a portable way.
      
      llvm-svn: 218187
      b7fbf593
    • Todd Fiala's avatar
      Fix lldb-gdbserver build. · 21130fbc
      Todd Fiala authored
      Build break change by Paul Osmialowski.
      
      Minor changes to argument passing (converted unintentional pass-by-value to pass-by-ref) by Todd.
      
      llvm-svn: 218186
      21130fbc
    • Justin Bogner's avatar
      llvm-cov: Allow creating CoverageMappings from filenames · 19a93ba8
      Justin Bogner authored
      llvm-svn: 218185
      19a93ba8
  2. Sep 20, 2014
    • Justin Bogner's avatar
      llvm-cov: Disentangle the coverage data logic from the display (NFC) · 953e2407
      Justin Bogner authored
      This splits the logic for actually looking up coverage information
      from the logic that displays it. These were tangled rather thoroughly
      so this change is a bit large, but it mostly consists of moving things
      around. The coverage lookup logic itself now lives in the library,
      rather than being spread between the library and the tool.
      
      llvm-svn: 218184
      953e2407
    • Justin Bogner's avatar
      llvm-cov: Move some reader debug output out of the tool. · f584649a
      Justin Bogner authored
      This debug output is really for testing CoverageMappingReader, not the
      llvm-cov tool. Move it to where it can be more useful.
      
      llvm-svn: 218183
      f584649a
    • Lenny Maiorani's avatar
      Using a deque to manage the stack of nodes is faster here. · 9eefc812
      Lenny Maiorani authored
        Vector is slow due to many reallocations as the size regularly changes in
        unpredictable ways. See the investigation provided on the mailing list for
        more information:
      
      http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120116/135228.html
      
      llvm-svn: 218182
      9eefc812
    • Jason Molenda's avatar
      Have CommandObject::CheckRequirements() report the largest missing · e59b0d2c
      Jason Molenda authored
      requirement for a command instead of the smallest.  e.g. if a command
      requires a Target, Process, Thread, and Frame, and none of those
      are available, report the largest -- Target -- as being missing
      instead of the smallest -- Frame.
      
      Patch by Paul Osmialowski.
      
      llvm-svn: 218181
      e59b0d2c
    • David Majnemer's avatar
      MC: Treat ReadOnlyWithRel and ReadOnlyWithRelLocal as ReadOnly for COFF · b8dbebb3
      David Majnemer authored
      A problem with our old behavior becomes observable under x86-64 COFF
      when we need a read-only GV which has an initializer which is referenced
      using a relocation: we would mark the section as writable.  Marking the
      section as writable interferes with section merging.
      
      This fixes PR21009.
      
      llvm-svn: 218179
      b8dbebb3
    • Chandler Carruth's avatar
      [x86] Teach the v4f32 path of the new shuffle lowering to handle the · 8c4cccd4
      Chandler Carruth authored
      tricky case of single-element insertion into the zero lane of a zero
      vector.
      
      We can't just use the same pattern here as we do in every other vector
      type because the general insertion logic can handle insertion into the
      non-zero lane of the vector. However, in SSE4.1 with v4f32 vectors we
      have INSERTPS that is a much better choice than the generic one for such
      lowerings. But INSERTPS can do lots of other lowerings as well so
      factoring its logic into the general insertion logic doesn't work very
      well. We also can't just extract the core common part of the general
      insertion logic that is faster (forming VZEXT_MOVL synthetic nodes that
      lower to MOVSS when they can) because VZEXT_MOVL is often *faster* than
      a blend while INSERTPS is slower! So instead we do a restrictive
      condition on attempting to use the generic insertion logic to narrow it
      to those cases where VZEXT_MOVL won't need a shuffle afterward and thus
      will do better than INSERTPS. Then we try blending. Then we go back to
      INSERTPS.
      
      This still doesn't generate perfect code for some silly reasons that can
      be fixed by tweaking the td files for lowering VZEXT_MOVL to use
      XORPS+BLENDPS when available rather than XORPS+MOVSS when the input ends
      up in a register rather than a load from memory -- BLENDPSrr has twice
      the reciprocal throughput of MOVSSrr. Don't you love this ISA?
      
      llvm-svn: 218177
      8c4cccd4
    • Chandler Carruth's avatar
      [x86] Refactor the code for emitting INSERTPS to reuse the zeroable mask · 87dcf093
      Chandler Carruth authored
      analysis used elsewhere. This removes the last duplicate of this logic.
      Also simplify the code here quite a bit. No functionality changed.
      
      llvm-svn: 218176
      87dcf093
    • Chandler Carruth's avatar
      [x86] Generalize the single-element insertion lowering to work with · 00389f3e
      Chandler Carruth authored
      floating point types and use it for both v2f64 and v2i64 single-element
      insertion lowering.
      
      This fixes the last non-AVX performance regression test case I've gotten
      of for the new vector shuffle lowering. There is obvious analogous
      lowering for v4f32 that I'll add in a follow-up patch (because with
      INSERTPS, v4f32 requires special treatment). After that, its AVX stuff.
      
      llvm-svn: 218175
      00389f3e
    • Chandler Carruth's avatar
      [x86] Replace some duplicated logic reasoning about whether particular · dba8444c
      Chandler Carruth authored
      vector lanes can be modeled as zero with a call to the new function that
      computes a bit-vector representing that information.
      
      No functionality changed here, but will allow doing more clever things
      with the zero-test.
      
      llvm-svn: 218174
      dba8444c
    • Akira Hatanaka's avatar
      Fix bugs in cpuid.h. · 416efb5f
      Akira Hatanaka authored
      This commit makes two changes:
      
      - Remove the push and pop instructions that were saving and restoring %ebx
        before and after cpuid in 32-bit pic mode. We were doing this to ensure we
        don't lose the GOT address in pic register %ebx, but this isn't necessary
        because the GOT address is kept in a virtual register.
      
      - In 64-bit mode, preserve base register %rbx around cpuid.
      
      This fixes PR20311 and rdar://problem/17686779.
      
      llvm-svn: 218173
      416efb5f
    • David Majnemer's avatar
      llvm-readobj: pretty-print special COFF section names · f4dc456e
      David Majnemer authored
      Print IMAGE_SYM_DEBUG and the like instead of (-2).
      
      llvm-svn: 218172
      f4dc456e
    • Peter Collingbourne's avatar
      Fix crash with an insertvalue that produces an empty object. · 97572634
      Peter Collingbourne authored
      llvm-svn: 218171
      97572634
    • Robin Morisset's avatar
      [X86] Erase some obsolete comments from README.txt · d780781b
      Robin Morisset authored
      I just tried reproducing some of the optimization failures in README.txt in the
      X86 backend, and many of them could not be reproduced. In general the entire
      file appears quite bit-rotted, whatever interesting parts remain should be
      moved to bugzilla, and the rest deleted. I did not spend the time to do that,
      so I just deleted the few I tried reproducing which are obsolete, to save some
      time to whoever will find the courage to do it.
      
      llvm-svn: 218170
      d780781b
    • Eric Christopher's avatar
      constify the TargetMachine being passed through the Mips subtarget · b1526600
      Eric Christopher authored
      creation.
      
      llvm-svn: 218169
      b1526600
    • Chris Bieneman's avatar
      Converting InstrProf's error_category to a ManagedStatic to avoid static... · 1efe8010
      Chris Bieneman authored
      Converting InstrProf's error_category to a ManagedStatic to avoid static constructors and destructors.
      
      llvm-svn: 218168
      1efe8010