Skip to content
  1. Jul 02, 2013
    • Manman Ren's avatar
      Debug Info: cleanup · d0e67aa1
      Manman Ren authored
      llvm-svn: 185456
      d0e67aa1
    • Jakob Stoklund Olesen's avatar
      Revert (most of) r185393 and r185395. · 13be6bfb
      Jakob Stoklund Olesen authored
      "Remove floating point computations form SpillPlacement.cpp."
      
      These commits caused test failures in lencod on clang-native-arm-lnt.
      
      I suspect these changes are only exposing an existing issue, but
      reverting anyway to keep the bots passing while we investigate.
      
      llvm-svn: 185447
      13be6bfb
    • Benjamin Kramer's avatar
      Hexagon: Avoid unused variable warnings in Release builds. · 755bf4f6
      Benjamin Kramer authored
      llvm-svn: 185445
      755bf4f6
    • Michael Gottesman's avatar
      [APFloat] Swap an early out check so we do not dereference str.end(). · 94d6195f
      Michael Gottesman authored
      Originally if D.firstSigDigit == str.end(), we will have already dereferenced
      D.firstSigDigit in the first predicate.
      
      llvm-svn: 185437
      94d6195f
    • Rafael Espindola's avatar
      Remove address spaces from MC. · 64e1af8e
      Rafael Espindola authored
      This is dead code since PIC16 was removed in 2010. The result was an odd mix,
      where some parts would carefully pass it along and others would assert it was
      zero (most of the object streamer for example).
      
      llvm-svn: 185436
      64e1af8e
    • Richard Sandiford's avatar
      [SystemZ] Use DSGFR over DSGR in more cases · e6e78855
      Richard Sandiford authored
      Fixes some cases where we were using full 64-bit division for (sdiv i32, i32)
      and (sdiv i64, i32).
      
      The "32" in "SDIVREM32" just refers to the second operand.  The first operand
      of all *DIVREM*s is a GR128.
      
      llvm-svn: 185435
      e6e78855
    • Richard Sandiford's avatar
      [SystemZ] Use MVC to spill loads and stores · f6bae1e4
      Richard Sandiford authored
      Try to use MVC when spilling the destination of a simple load or the source
      of a simple store.  As explained in the comment, this doesn't yet handle
      the case where the load or store location is also a frame index, since
      that could lead to two simultaneous scavenger spills, something the
      backend can't handle yet.  spill-02.py tests that this restriction kicks in,
      but unfortunately I've not yet found a case that would fail without it.
      The volatile trick I used for other scavenger tests doesn't work here
      because we can't use MVC for volatile accesses anyway.
      
      I'm planning on relaxing the restriction later, hopefully with a test
      that does trigger the problem...
      
      Tests @f8 and @f9 also showed that L(G)RL and ST(G)RL were wrongly
      classified as SimpleBDX{Load,Store}.  It wouldn't be easy to test for
      that bug separately, which is why I didn't split out the fix as a
      separate patch.
      
      llvm-svn: 185434
      f6bae1e4
    • Richard Sandiford's avatar
      [SystemZ] Add the MVC instruction · 1d959008
      Richard Sandiford authored
      This is the first use of D(L,B) addressing, which required a fair bit
      of surgery.  For that reason, the patch just adds the instruction
      definition and the associated assembler and disassembler support.
      A later patch will actually make use of it for codegen.
      
      llvm-svn: 185433
      1d959008
    • Richard Osborne's avatar
      [XCore] Fix instruction selection for zext, mkmsk instructions. · e4cc9868
      Richard Osborne authored
      r182680 replaced CountLeadingZeros_32 with a template function
      countLeadingZeros that relies on using the correct argument type to give
      the right result. The type passed in the XCore backend after this
      revision was incorrect in a couple of places.
      
      Patch by Robert Lytton.
      
      llvm-svn: 185430
      e4cc9868
    • Logan Chien's avatar
      Fix ARM EHABI compact model 1 and 2 without handlerdata. · c931fce4
      Logan Chien authored
      According to ARM EHABI section 9.2, if the
      __aeabi_unwind_cpp_pr1() or __aeabi_unwind_cpp_pr2() is
      used, then the handler data must be emitted after the unwind
      opcodes.  The handler data consists of several words, and
      should be terminated by zero.
      
      In case that the .handlerdata directive is not specified by
      the programmer, we should emit zero to terminate the handler
      data.
      
      llvm-svn: 185422
      c931fce4
    • Elena Demikhovsky's avatar
    • Tim Northover's avatar
      DAGCombiner: fix use-counting issue when forming zextload · 6823900e
      Tim Northover authored
      DAGCombiner was counting all uses of a load node  when considering whether it's
      worth combining into a zextload. Really, it wants to ignore the chain and just
      count real uses.
      
      rdar://problem/13896307
      
      llvm-svn: 185419
      6823900e
    • Hal Finkel's avatar
      Revert r185257 (InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms) · fdbe161b
      Hal Finkel authored
      I'm reverting this commit because:
      
       1. As discussed during review, it needs to be rewritten (to avoid creating and
      then deleting instructions).
      
       2. This is causing optimizer crashes. Specifically, I'm seeing things like
      this:
      
          While deleting: i1 %
          Use still stuck around after Def is destroyed:  <badref> = select i1 <badref>, i32 0, i32 1
          opt: /src/llvm-trunk/lib/IR/Value.cpp:79: virtual llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.
      
         I'd guess that these will go away once we're no longer creating/deleting
      instructions here, but just in case, I'm adding a regression test.
      
      Because the code is bring rewritten, I've just XFAIL'd the original regression test. Original commit message:
      
      	InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms
      
      	Real world code sometimes has the denominator of a 'udiv' be a
      	'select'.  LLVM can handle such cases but only when the 'select'
      	operands are symmetric in structure (both select operands are a constant
      	power of two or a left shift, etc.).  This falls apart if we are dealt a
      	'udiv' where the code is not symetric or if the select operands lead us
      	to more select instructions.
      
      	Instead, we should treat the LHS and each select operand as a distinct
      	divide operation and try to optimize them independently.  If we can
      	to simplify each operation, then we can replace the 'udiv' with, say, a
      	'lshr' that has a new select with a bunch of new operands for the
      	select.
      
      llvm-svn: 185415
      fdbe161b
    • Nick Lewycky's avatar
      Add missing break statements. Noticed by inspection. · 26fcc51f
      Nick Lewycky authored
      llvm-svn: 185414
      26fcc51f
    • Hal Finkel's avatar
      Cleanup PPC Altivec registers in CSR lists and improve VRSAVE handling · 52727c6b
      Hal Finkel authored
      There are a couple of (small) related changes here:
      
      1. The printed name of the VRSAVE register has been changed from VRsave to
      vrsave in order to match the name accepted by GNU binutils.
      
      2. Support for parsing vrsave has been added to the asm parser (it seems that
      there was no test case specifically covering this code, so I've added one).
      
      3. The list of Altivec registers, which was common to all calling conventions,
      has been separated out. This allows us to define the base CSR lists, and then
      lists for each ABI with Altivec included. This allows SjLj, for example, to
      work correctly on non-Altivec targets without using unnatural definitions of
      the NoRegs CSR list.
      
      4. VRSAVE is now always reserved on non-Darwin targets and all Altivec
      registers are reserved when Altivec is disabled.
      
      With these changes, it is now possible to compile a function containing
      __builtin_unwind_init() on Linux/PPC64 with debugging information. This did not
      work previously because GNU binutils assumes that all .cfi_offset offsets will
      be 8-byte aligned on PPC64 (and errors out if you provide a non-8-byte-aligned
      offset). This is not true for the vrsave register, however, because this
      register is used only on Darwin, GCC does not bother printing a .cfi_offset
      entry for it (even though there is a slot in the stack frame for it as
      specified by the ABI). This change allows us to do the same: we will also not
      print .cfi_offset directives for vrsave.
      
      llvm-svn: 185409
      52727c6b
    • Tobias Grosser's avatar
      IRVerifier: Correctly check attribute types · effd02c9
      Tobias Grosser authored
      Add missing parenthesis such that all and not only the very first attribute
      is checked.
      
      Testing this piece of code is not possible with an LLVM-IR test file, as the
      LLVM-IR parser has a similar check such that the wrong IR does not even arrive
      at the verifier.
      
      llvm-svn: 185408
      effd02c9
    • Akira Hatanaka's avatar
      [mips] Add new InstrItinClasses for move from/to coprocessor instructions and · b34ad786
      Akira Hatanaka authored
      floating point loads and stores.
      
      No changes in functionality.
      
      llvm-svn: 185399
      b34ad786
    • David Blaikie's avatar
      PR14728: DebugInfo: TLS variables with -gsplit-dwarf · 8466ca86
      David Blaikie authored
      llvm-svn: 185398
      8466ca86
    • Michael Gottesman's avatar
    • Jakob Stoklund Olesen's avatar
      3b4e9ccf
    • Ulrich Weigand's avatar
      · f11efe7f
      Ulrich Weigand authored
      [PowerPC] Add support for TLS data relocations
      
      This adds support for TLS data relocations and modifiers:
             .quad target@dtpmod
             .quad target@tprel
             .quad target@dtprel
      Currently exploited by the asm parser only.
      
      llvm-svn: 185394
      f11efe7f
    • Jakob Stoklund Olesen's avatar
      Remove floating point computations form SpillPlacement.cpp. · 55daed27
      Jakob Stoklund Olesen authored
      Patch by Benjamin Kramer!
      
      Use the BlockFrequency class instead of floats in the Hopfield network
      computations. This rescales the node Bias field from a [-2;2] float
      range to two block frequencies BiasN and BiasP pulling in opposite
      directions. This construct has a more predictable behavior when block
      frequencies saturate.
      
      The per-node scaling factors are no longer necessary, assuming the block
      frequencies around a bundle are consistent.
      
      This patch can cause the register allocator to make different spilling
      decisions. The differences should be small.
      
      llvm-svn: 185393
      55daed27
    • Richard Trieu's avatar
  2. Jul 01, 2013
    • David Blaikie's avatar
      PR16493: DebugInfo with TLS on PPC crashing due to invalid relocation · 1b01ae86
      David Blaikie authored
      Restrict the current TLS support to X86 ELF for now. Test that we don't
      produce it on PPC & we can flesh that test case out with the right thing
      once someone implements it.
      
      llvm-svn: 185389
      1b01ae86
    • Ulrich Weigand's avatar
      · 85c6f7f7
      Ulrich Weigand authored
      [PowerPC] Support all condition register logical instructions
      
      This adds support for all missing condition register logical
      instructions and extended mnemonics to the asm parser.
      
      llvm-svn: 185387
      85c6f7f7
    • Chad Rosier's avatar
      Add a newline. · 797ee3e3
      Chad Rosier authored
      llvm-svn: 185385
      797ee3e3
    • Manman Ren's avatar
      Debug Info: clean up usage of Verify. · 74c188f0
      Manman Ren authored
      No functionality change. It should suffice to check the type of a debug info
      metadata, instead of calling Verify.
      
      llvm-svn: 185383
      74c188f0
    • Bill Schmidt's avatar
      Index: test/CodeGen/PowerPC/reloc-align.ll · 48fc20a0
      Bill Schmidt authored
      ===================================================================
      --- test/CodeGen/PowerPC/reloc-align.ll	(revision 0)
      +++ test/CodeGen/PowerPC/reloc-align.ll	(revision 0)
      @@ -0,0 +1,34 @@
      +; RUN: llc -mcpu=pwr7 -O1 < %s | FileCheck %s
      +
      +; This test verifies that the peephole optimization of address accesses
      +; does not produce a load or store with a relocation that can't be
      +; satisfied for a given instruction encoding.  Reduced from a test supplied
      +; by Hal Finkel.
      +
      +target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
      +target triple = "powerpc64-unknown-linux-gnu"
      +
      +%struct.S1 = type { [8 x i8] }
      +
      +@main.l_1554 = internal global { i8, i8, i8, i8, i8, i8, i8, i8 } { i8 -1, i8 -6, i8 57, i8 62, i8 -48, i8 0, i8 58, i8 80 }, align 1
      +
      +; Function Attrs: nounwind readonly
      +define signext i32 @main() #0 {
      +entry:
      +  %call = tail call fastcc signext i32 @func_90(%struct.S1* byval bitcast ({ i8, i8, i8, i8, i8, i8, i8, i8 }* @main.l_1554 to %struct.S1*))
      +; CHECK-NOT: ld {{[0-9]+}}, main.l_1554@toc@l
      +  ret i32 %call
      +}
      +
      +; Function Attrs: nounwind readonly
      +define internal fastcc signext i32 @func_90(%struct.S1* byval nocapture %p_91) #0 {
      +entry:
      +  %0 = bitcast %struct.S1* %p_91 to i64*
      +  %bf.load = load i64* %0, align 1
      +  %bf.shl = shl i64 %bf.load, 26
      +  %bf.ashr = ashr i64 %bf.shl, 54
      +  %bf.cast = trunc i64 %bf.ashr to i32
      +  ret i32 %bf.cast
      +}
      +
      +attributes #0 = { nounwind readonly "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf"="true" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
      Index: lib/Target/PowerPC/PPCAsmPrinter.cpp
      ===================================================================
      --- lib/Target/PowerPC/PPCAsmPrinter.cpp	(revision 185327)
      +++ lib/Target/PowerPC/PPCAsmPrinter.cpp	(working copy)
      @@ -679,7 +679,26 @@ void PPCAsmPrinter::EmitInstruction(const MachineI
             OutStreamer.EmitRawText(StringRef("\tmsync"));
             return;
           }
      +    break;
      +  case PPC::LD:
      +  case PPC::STD:
      +  case PPC::LWA: {
      +    // Verify alignment is legal, so we don't create relocations
      +    // that can't be supported.
      +    // FIXME:  This test is currently disabled for Darwin.  The test
      +    // suite shows a handful of test cases that fail this check for
      +    // Darwin.  Those need to be investigated before this sanity test
      +    // can be enabled for those subtargets.
      +    if (!Subtarget.isDarwin()) {
      +      unsigned OpNum = (MI->getOpcode() == PPC::STD) ? 2 : 1;
      +      const MachineOperand &MO = MI->getOperand(OpNum);
      +      if (MO.isGlobal() && MO.getGlobal()->getAlignment() < 4)
      +        llvm_unreachable("Global must be word-aligned for LD, STD, LWA!");
      +    }
      +    // Now process the instruction normally.
      +    break;
         }
      +  }
       
         LowerPPCMachineInstrToMCInst(MI, TmpInst, *this);
         OutStreamer.EmitInstruction(TmpInst);
      Index: lib/Target/PowerPC/PPCISelDAGToDAG.cpp
      ===================================================================
      --- lib/Target/PowerPC/PPCISelDAGToDAG.cpp	(revision 185327)
      +++ lib/Target/PowerPC/PPCISelDAGToDAG.cpp	(working copy)
      @@ -1530,6 +1530,14 @@ void PPCDAGToDAGISel::PostprocessISelDAG() {
             if (GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(ImmOpnd)) {
               SDLoc dl(GA);
               const GlobalValue *GV = GA->getGlobal();
      +        // We can't perform this optimization for data whose alignment
      +        // is insufficient for the instruction encoding.
      +        if (GV->getAlignment() < 4 &&
      +            (StorageOpcode == PPC::LD || StorageOpcode == PPC::STD ||
      +             StorageOpcode == PPC::LWA)) {
      +          DEBUG(dbgs() << "Rejected this candidate for alignment.\n\n");
      +          continue;
      +        }
               ImmOpnd = CurDAG->getTargetGlobalAddress(GV, dl, MVT::i64, 0, Flags);
             } else if (ConstantPoolSDNode *CP =
                        dyn_cast<ConstantPoolSDNode>(ImmOpnd)) {
      
      llvm-svn: 185380
      48fc20a0
    • Chad Rosier's avatar
      [ARMAsmParser] Sort the ARM register lists based on the encoding value, not the · fa705ee3
      Chad Rosier authored
      tablegen enum values.  This should be the last fix due to fallout from r185094.
      
      llvm-svn: 185379
      fa705ee3
    • Lang Hames's avatar
      Make PBQP require/preserve MachineLoopInfo - the spiller requires it. · 7d99d797
      Lang Hames authored
      llvm-svn: 185378
      7d99d797
    • Akira Hatanaka's avatar
      [mips] Reverse the order of source operands of shift and rotate instructions that · 1af66c9b
      Akira Hatanaka authored
      have three register operands.
      
      No intended functionality changes.
      
      llvm-svn: 185376
      1af66c9b
    • Ulrich Weigand's avatar
      · f7152a85
      Ulrich Weigand authored
      [PowerPC] Also add "msync" alias
      
      This adds an alias for "msync" (which is used on Book E
      systems instead of "sync").
      
      llvm-svn: 185375
      f7152a85
    • Akira Hatanaka's avatar
      [mips] Increase the number of floating point control registers available to 32. · 263c6af8
      Akira Hatanaka authored
      Create a dedicated register class for floating point condition code registers and
      move FCC0 from register class CCR to the new register class.
      
      llvm-svn: 185373
      263c6af8
    • Cameron Zwarich's avatar
      Fix the build after r185363. Use llvm::next instead of raw next. · e35038da
      Cameron Zwarich authored
      llvm-svn: 185367
      e35038da
    • Anton Korobeynikov's avatar
      Add jump tables handling for MSP430. · 82bedb1f
      Anton Korobeynikov authored
      Patch by Job Noorman!
      
      llvm-svn: 185364
      82bedb1f
    • Cameron Zwarich's avatar
      Fix PR16508. · 867bfcd5
      Cameron Zwarich authored
      When phis get lowered, destination copies are inserted using an iterator that is
      determined once for all phis in the block, which BuildMI interprets as a request
      to insert an instruction directly before the iterator. In the case of a cyclic
      phi, source copies may also be inserted directly before this iterator, which can
      cause source copies to be inserted before destination copies. The fix is to keep
      an iterator to the last phi and then advance it while lowering each phi in order
      to insert destination copies directly after the phis.
      
      llvm-svn: 185363
      867bfcd5
    • Hal Finkel's avatar
      Don't form PPC CTR loops for over-sized exit counts · 25e4a0d4
      Hal Finkel authored
      Although you can't generate this from C on PPC64, if you have a loop using a
      64-bit counter on PPC32 then you can't form a CTR-based loop for it. This had
      been cauing the PPCCTRLoops pass to assert.
      
      Thanks to Joerg Sonnenberger for providing a test case!
      
      llvm-svn: 185361
      25e4a0d4
    • Tim Northover's avatar
      AArch64: correct CodeGen of MOVZ/MOVK combinations. · 8625fd8c
      Tim Northover authored
      According to the AArch64 ELF specification (4.6.8), it's the
      assembler's responsibility to make sure the shift amount is correct in
      relocated MOVZ/MOVK instructions.
      
      This wasn't being obeyed by either the MCJIT CodeGen or RuntimeDyldELF
      (which happened to work out well for JIT tests). This commit should
      make us compliant in this area.
      
      llvm-svn: 185360
      8625fd8c
    • Tim Northover's avatar
      Revert r185339 (ARM: relax the atomic release barrier to "dmb ishst") · 7f3d9e1f
      Tim Northover authored
      Turns out I'd misread the architecture reference manual and thought
      that was a load/store-store barrier, when it's not.
      
      Thanks for pointing it out Eli!
      
      llvm-svn: 185356
      7f3d9e1f
    • Manman Ren's avatar
      Debug Info: Scope of a DebugLoc should not be null. · 08016a65
      Manman Ren authored
      No functionality change. Remove handling for the null case.
      
      llvm-svn: 185354
      08016a65
Loading