Skip to content
  1. Jul 09, 2013
    • Adrian Prantl's avatar
      Reapply an improved version of r180816/180817. · 418d1d1e
      Adrian Prantl authored
      Change the informal convention of DBG_VALUE machine instructions so that
      we can express a register-indirect address with an offset of 0.
      The old convention was that a DBG_VALUE is a register-indirect value if
      the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE
      is register-indirect if the first operand is a register and the second
      operand is an immediate. For plain register values the combination reg,
      reg is used. MachineInstrBuilder::BuildMI knows how to build the new
      DBG_VALUES.
      
      rdar://problem/13658587
      
      llvm-svn: 185966
      418d1d1e
    • Hal Finkel's avatar
      WidenVecRes_BUILD_VECTOR must use the first operand's type · e4dd5c29
      Hal Finkel authored
      Because integer BUILD_VECTOR operands may have a larger type than the result's
      vector element type, and all operands must have the same type, when widening a
      BUILD_VECTOR node by adding UNDEFs, we cannot use the vector element type, but
      rather must use the type of the existing operands.
      
      Another bug found by llvm-stress.
      
      llvm-svn: 185960
      e4dd5c29
    • Bill Schmidt's avatar
      [PowerPC] Better fix for PR16556. · 41221693
      Bill Schmidt authored
      A more complete example of the bug in PR16556 was recently provided,
      showing that the previous fix was not sufficient.  The previous fix is
      reverted herein.
      
      The real problem is that ReplaceNodeResults() uses LowerFP_TO_INT as
      custom lowering for FP_TO_SINT during type legalization, without
      checking whether the input type is handled by that routine.
      LowerFP_TO_INT requires the input to be f32 or f64, so we fail when
      the input is ppcf128.
      
      I'm leaving the test case from the initial fix (r185821) in place, and
      adding the new test as another crash-only check.
      
      llvm-svn: 185959
      41221693
    • Stephen Lin's avatar
      AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all · 73de7bf5
      Stephen Lin authored
      in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in
      order to resolve the following issues with fmuladd (i.e. optional FMA)
      intrinsics:
      
      1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd
      intrinsics even if the subtarget does not support FMA instructions, leading
      to laughably bad code generation in some situations.
      
      2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128,
      resulting in a call to a software fp128 FMA implementation.
      
      3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types
      like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize,
      etc. to types that support hardware FMAs.
      
      The function has also been slightly renamed for consistency and to force a
      merge/build conflict for any out-of-tree target implementing it. To resolve,
      see comments and fixed in-tree examples.
      
      llvm-svn: 185956
      73de7bf5
    • Hal Finkel's avatar
      Don't crash in SE dealing with ashr x, -1 · ff666bd9
      Hal Finkel authored
      ScalarEvolution::getSignedRange uses ComputeNumSignBits from ValueTracking on
      ashr instructions. ComputeNumSignBits can return zero, but this case was not
      handled correctly by the code in getSignedRange which was calling:
        APInt::getSignedMinValue(BitWidth).ashr(NS - 1)
      with NS = 0, resulting in an assertion failure in APInt::ashr.
      
      Now, we just return the conservative result (as with NS == 1).
      
      Another bug found by llvm-stress.
      
      llvm-svn: 185955
      ff666bd9
    • David Majnemer's avatar
      ValueTracking: Fix bugs in isKnownToBeAPowerOfTwo · a92b3c91
      David Majnemer authored
      (add nsw x, (and x, y)) isn't a power of two if x is zero, it's zero
      (add nsw x, (xor x, y)) isn't a power of two if y has bits set that aren't set in x
      
      llvm-svn: 185954
      a92b3c91
    • Nadav Rotem's avatar
      861bef7d
    • Hal Finkel's avatar
      DAGCombine tryFoldToZero cannot create illegal types after type legalization · 6c29bd90
      Hal Finkel authored
      When folding sub x, x (and other similar constructs), where x is a vector, the
      result is a vector of zeros. After type legalization, make sure that the input
      zero elements have a legal type. This type may be larger than the result's
      vector element type.
      
      This was another bug found by llvm-stress.
      
      llvm-svn: 185949
      6c29bd90
    • Ulrich Weigand's avatar
      · 52cf8e44
      Ulrich Weigand authored
      [PowerPC] Revert r185476 and fix up TLS variant kinds
      
      In the commit message to r185476 I wrote:
      
      >The PowerPC-specific modifiers VK_PPC_TLSGD and VK_PPC_TLSLD
      >correspond exactly to the generic modifiers VK_TLSGD and VK_TLSLD.
      >This causes some confusion with the asm parser, since VK_PPC_TLSGD
      >is output as @tlsgd, which is then read back in as VK_TLSGD.
      >
      >To avoid this confusion, this patch removes the PowerPC-specific
      >modifiers and uses the generic modifiers throughout.  (The only
      >drawback is that the generic modifiers are printed in upper case
      >while the usual convention on PowerPC is to use lower-case modifiers.
      >But this is just a cosmetic issue.)
      
      This was unfortunately incorrect, there is is fact another,
      serious drawback to using the default VK_TLSLD/VK_TLSGD
      variant kinds: using these causes ELFObjectWriter::RelocNeedsGOT
      to return true, which in turn causes the ELFObjectWriter to emit
      an undefined reference to _GLOBAL_OFFSET_TABLE_.
      
      This is a problem on powerpc64, because it uses the TOC instead
      of the GOT, and the linker does not provide _GLOBAL_OFFSET_TABLE_,
      so the symbol remains undefined.  This means shared libraries
      using TLS built with the integrated assembler are currently
      broken.
      
      While the whole RelocNeedsGOT / _GLOBAL_OFFSET_TABLE_ situation
      probably ought to be properly fixed at some point, for now I'm
      simply reverting the r185476 commit.  Now this in turn exposes
      the breakage of handling @tlsgd/@tlsld in the asm parser that
      this check-in was originally intended to fix.
      
      To avoid this regression, I'm also adding a different fix for
      this problem: while common code now parses @tlsgd as VK_TLSGD,
      a special hack in the asm parser translates this code to the
      platform-specific VK_PPC_TLSGD that the back-end now expects.
      While this is not really pretty, it's self-contained and
      shouldn't hurt anything else for now.  One the underlying
      problem is fixed, this hack can be reverted again.
      
      llvm-svn: 185945
      52cf8e44
    • Vincent Lejeune's avatar
      R600: Do not predicated basic block with multiple alu clause · ce499744
      Vincent Lejeune authored
      Test is not included as it is several 1000 lines long.
      To test this functionnality, a test case must generate at least 2 ALU clauses,
      where an ALU clause is ~110 instructions long.
      
      NOTE: This is a candidate for the stable branch.
      llvm-svn: 185943
      ce499744
    • Vincent Lejeune's avatar
      b8aac8d7
    • Vincent Lejeune's avatar
      R600: Fix wrong export reswizzling · a4d8d2ef
      Vincent Lejeune authored
      llvm-svn: 185941
      a4d8d2ef
    • Vincent Lejeune's avatar
      R600: Use DAG lowering pass to handle fcos/fsin · b55940cc
      Vincent Lejeune authored
      NOTE: This is a candidate for the stable branch.
      llvm-svn: 185940
      b55940cc
    • Vincent Lejeune's avatar
      R600: Print Export Swizzle · f10d1cd2
      Vincent Lejeune authored
      llvm-svn: 185939
      f10d1cd2
    • Rafael Espindola's avatar
      Add missing getters. They will be used in llvm-ar. · 8115e1da
      Rafael Espindola authored
      llvm-svn: 185937
      8115e1da
    • Rafael Espindola's avatar
      Archive members cannot be larger than 4GB. Return a uint32_t. · 8e9385ec
      Rafael Espindola authored
      llvm-svn: 185936
      8e9385ec
    • Rafael Espindola's avatar
      Add getHeader helper and move ToHeader to the cpp file. · 97ee9de6
      Rafael Espindola authored
      llvm-svn: 185933
      97ee9de6
    • Joey Gouly's avatar
      Add MC assembly/disassembly support for VRINT{A, N, P, M} to V8FP. · 0f12aa2b
      Joey Gouly authored
      llvm-svn: 185929
      0f12aa2b
    • Joey Gouly's avatar
      Add MC assembly/disassembly support for VRINT{Z, X, R} to V8FP. · 3b693c42
      Joey Gouly authored
      llvm-svn: 185926
      3b693c42
    • Ulrich Weigand's avatar
      · 55daa779
      Ulrich Weigand authored
      [PowerPC] Support ".machine any"
      
      The PowerPC assembler is supposed to provide a directive .machine
      that allows switching the supported CPU instruction set on the fly.
      Since we do not yet check CPU feature sets at all and always accept
      any available instruction, this is not really useful at this point.
      
      However, it makes sense to accept (and ignore) ".machine any" to
      avoid spuriously rejecting existing assembler files that use this.
      
      llvm-svn: 185924
      55daa779
    • Alexander Potapenko's avatar
      Revert r185872 - "Stop emitting weak symbols into the "coal" sections" · 8d2d79d0
      Alexander Potapenko authored
      This patch broke `make check-asan` on Mac, causing ld warnings like the following one:
      
      ld: warning: direct access in __GLOBAL__I_a to global weak symbol
      ___asan_mapping_scale means the weak symbol cannot be overridden at
      runtime. This was likely caused by different translation units being
      compiled with different visibility settings.
      
      The resulting test binaries crashed with incorrect ASan warnings.
      
      llvm-svn: 185923
      8d2d79d0
    • Joey Gouly's avatar
      Add MC assembly/disassembly support for VCVT{A, N, P, M} to V8FP. · 2d0175e8
      Joey Gouly authored
      llvm-svn: 185922
      2d0175e8
    • Richard Sandiford's avatar
      [SystemZ] Use MVC for simple load/store pairs · 97846491
      Richard Sandiford authored
      Look for patterns of the form (store (load ...), ...) in which the two
      locations are known not to partially overlap.  (Identical locations are OK.)
      These sequences are better implemented by MVC unless either the load or
      the store could use RELATIVE LONG instructions.
      
      The testcase showed that we weren't using LHRL and LGHRL for extload16,
      only sextloadi16.  The patch fixes that too.
      
      llvm-svn: 185919
      97846491
    • Richard Sandiford's avatar
      [SystemZ] Use "STC;MVC" for memset · 47660c14
      Richard Sandiford authored
      Use "STC;MVC" for memsets that are too big for two STCs or MV...Is yet
      small enough for a single MVC.  As with memcpy, I'm leaving longer cases
      till later.
      
      The number of tests might seem excessive, but f33 & f34 from memset-04.ll
      failed the first cut because I'd not added the "?:" on the calculation
      of Size1.
      
      llvm-svn: 185918
      47660c14
    • David Majnemer's avatar
      InstCombine: Fix typo in comment for visitICmpInstWithInstAndIntCst · eeed73b9
      David Majnemer authored
      llvm-svn: 185916
      eeed73b9
    • David Majnemer's avatar
      InstCombine: variations on 0xffffffff - x >= 4 · 72d76275
      David Majnemer authored
      The following transforms are valid if -C is a power of 2:
      (icmp ugt (xor X, C), ~C) -> (icmp ult X, C)
      (icmp ult (xor X, C), -C) -> (icmp uge X, C)
      
      These are nice, they get rid of the xor.
      
      llvm-svn: 185915
      72d76275
    • David Majnemer's avatar
      InstCombine: X & -C != -C -> X <= u ~C · 414d4e58
      David Majnemer authored
      Tests were added in r185910 somehow.
      
      llvm-svn: 185912
      414d4e58
    • Ulrich Weigand's avatar
      · 78a5a116
      Ulrich Weigand authored
      [PowerPC] Support .llong and fix .word
      
      This adds support for the .llong PowerPC-specifc assembler directive.
      In doing so, I notices that .word is currently incorrect: it is
      supposed to define a 2-byte data element, not a 4-byte one.
      
      llvm-svn: 185911
      78a5a116
    • David Majnemer's avatar
      Commit r185909 was a misapplied patch, fix it · bafa537e
      David Majnemer authored
      llvm-svn: 185910
      bafa537e
    • David Majnemer's avatar
      InstCombine: add more transforms · f2a9a513
      David Majnemer authored
      C1-X <u C2 -> (X|(C2-1)) == C1
      C1-X >u C2 -> (X|C2) == C1
      X-C1 <u C2 -> (X & -C2) == C1
      X-C1 >u C2 -> (X & ~C2) == C1
      
      llvm-svn: 185909
      f2a9a513
    • Hal Finkel's avatar
      PPC: Allocate RS spill slot for unaligned i64 load/store · dbbf09b2
      Hal Finkel authored
      This fixes another bug found by llvm-stress!
      
      If we happen to be doing an i64 load or store into a stack slot that has less
      than a 4-byte alignment, then the frame-index elimination may need to use an
      indexed load or store instruction (because the offset may not be a multiple of
      4, a requirement of the STD/LD instructions). The extra register needed to hold
      the offset comes from the register scavenger, and it is possible that the
      scavenger will need to use an emergency spill slot. As a result, we need to
      make sure that a spill slot is allocated when doing an i64 load/store into a
      less-than-4-byte-aligned stack slot.
      
      Because test cases for things like this tend to be fairly fragile, I've
      concatenated a few small bugpoint-reduced test cases together to form the
      regression test.
      
      llvm-svn: 185907
      dbbf09b2
    • Rafael Espindola's avatar
      Compute the size of an archive member in the constructor. · 0f3de64d
      Rafael Espindola authored
      It is always computed the same way (by parsing the header). Doing it in the
      constructor simplifies the callers a bit.
      
      llvm-svn: 185905
      0f3de64d
    • Rafael Espindola's avatar
      Move some code out of line. No functionality change. · 747bc07b
      Rafael Espindola authored
      llvm-svn: 185901
      747bc07b
    • Jim Grosbach's avatar
      X86: Add comment. · 340b6da4
      Jim Grosbach authored
      llvm-svn: 185900
      340b6da4
    • Jim Grosbach's avatar
      X86 fast-isel: Avoid explicit AH subreg reference for [SU]Rem. · c35388f1
      Jim Grosbach authored
      Explicit references to %AH for an i8 remainder instruction can lead to
      references to %AH in a REX prefixed instruction, which causes things to
      blow up. Do the same thing in FastISel as we do for DAG isel and instead
      shift %AX right by 8 bits and then extract the 8-bit subreg from that
      result.
      
      rdar://14203849
      http://llvm.org/bugs/show_bug.cgi?id=16105
      
      llvm-svn: 185899
      c35388f1
    • Sean Silva's avatar
      Make BinaryRef output correctly in case of empty data. · 2f672d61
      Sean Silva authored
      Previously, it would simply output nothing, but it should output an
      empty string `""`.
      
      llvm-svn: 185894
      2f672d61
    • Stephen Lin's avatar
      Style fixes: remove unnecessary braces for one-statement if blocks, no else... · 8e8424eb
      Stephen Lin authored
      Style fixes: remove unnecessary braces for one-statement if blocks, no else after return, etc. No funcionality change.
      
      llvm-svn: 185893
      8e8424eb
    • Eric Christopher's avatar
      Revert "DebugInfo: remove unused helper function getDICompositeType." · 215a7758
      Eric Christopher authored
      This reverts commit r185876 as the functions appear to still be used
      by dragonegg.
      
      llvm-svn: 185890
      215a7758
    • Eli Bendersky's avatar
      Fix comment · 07b0e451
      Eli Bendersky authored
      llvm-svn: 185888
      07b0e451
    • Nadav Rotem's avatar
      · c9c57518
      Nadav Rotem authored
      This patch changes the saved IRBuilder insert point from BasicBlock::iterator to AssertingVH.
      
      Commit 185883 fixes a bug in the IRBuilder that should fix the ASan bot. AssertingVH can help in exposing some RAUW problems.
      
      Thanks Ben and Alexey!
      
      llvm-svn: 185886
      c9c57518
Loading