Skip to content
  1. Jan 14, 2014
    • Duncan P. N. Exon Smith's avatar
      LTO: add API to set strategy for -internalize · 43ea3478
      Duncan P. N. Exon Smith authored
      Add API to LTOCodeGenerator to specify a strategy for the -internalize
      pass.
      
      This is a new attempt at Bill's change in r185882, which he reverted in
      r188029 due to problems with the gold linker.  This puts the onus on the
      linker to decide whether (and what) to internalize.
      
      In particular, running internalize before outputting an object file may
      change a 'weak' symbol into an internal one, even though that symbol
      could be needed by an external object file --- e.g., with arclite.
      
      This patch enables three strategies:
      
      - LTO_INTERNALIZE_FULL: the default (and the old behaviour).
      - LTO_INTERNALIZE_NONE: skip -internalize.
      - LTO_INTERNALIZE_HIDDEN: only -internalize symbols with hidden
        visibility.
      
      LTO_INTERNALIZE_FULL should be used when linking an executable.
      
      Outputting an object file (e.g., via ld -r) is more complicated, and
      depends on whether hidden symbols should be internalized.  E.g., for
      ld -r, LTO_INTERNALIZE_NONE can be used when -keep_private_externs, and
      LTO_INTERNALIZE_HIDDEN can be used otherwise.  However,
      LTO_INTERNALIZE_FULL is inappropriate, since the output object file will
      eventually need to link with others.
      
      lto_codegen_set_internalize_strategy() sets the strategy for subsequent
      calls to lto_codegen_write_merged_modules() and lto_codegen_compile*().
      
      <rdar://problem/14334895>
      
      llvm-svn: 199191
      43ea3478
    • Jakob Stoklund Olesen's avatar
      Always let value types influence register classes. · b6b35a49
      Jakob Stoklund Olesen authored
      When creating a virtual register for a def, the value type should be
      used to pick the register class. If we only use the register class
      constraint on the instruction, we might pick a too large register class.
      
      Some registers can store values of different sizes. For example, the x86
      xmm registers can hold f32, f64, and 128-bit vectors. The three
      different value sizes are represented by register classes with identical
      register sets: FR32, FR64, and VR128. These register classes have
      different spill slot sizes, so it is important to use the right one.
      
      The register class constraint on an instruction doesn't necessarily care
      about the size of the value its defining. The value type determines
      that.
      
      This fixes a problem where InstrEmitter was picking 32-bit register
      classes for 64-bit values on SPARC.
      
      llvm-svn: 199187
      b6b35a49
    • Jakob Stoklund Olesen's avatar
      Switch the NEON register class from QPR to DPair. · 20912062
      Jakob Stoklund Olesen authored
      The already allocatable DPair superclass contains odd-even D register
      pair in addition to the even-odd pairs in the QPR register class. There
      is no reason to constrain the set of D register pairs that can be used
      for NEON values. Any NEON instructions that require a Q register will
      automatically constrain the register class to QPR.
      
      The allocation order for DPair begins with the QPR registers, so
      register allocation is unlikely to change much.
      
      llvm-svn: 199186
      20912062
    • Rafael Espindola's avatar
      Replace .mips_hack_stocg with ".set micromips" and ".set nomicromips". · 6d5f7ce3
      Rafael Espindola authored
      This matches what gnu as does and implementing this is easier than arguing
      about it.
      
      llvm-svn: 199181
      6d5f7ce3
    • Mark Seaborn's avatar
      Fix llc to not reuse spill slots in functions that invoke setjmp() · 8271118a
      Mark Seaborn authored
      We need to ensure that StackSlotColoring.cpp does not reuse stack
      spill slots in functions that call "returns_twice" functions such as
      setjmp(), otherwise this can lead to miscompiled code, because a stack
      slot would be clobbered when it's still live.
      
      This was already handled correctly for functions that call setjmp()
      (though this wasn't covered by a test), but not for functions that
      invoke setjmp().
      
      We fix this by changing callsFunctionThatReturnsTwice() to check for
      invoke instructions.
      
      This fixes PR18244.
      
      llvm-svn: 199180
      8271118a
    • Rafael Espindola's avatar
      Make getTargetStreamer return a possibly null pointer. · 4a1a3606
      Rafael Espindola authored
      This will allow it to be called from target independent parts of the main
      streamer that don't know if there is a registered target streamer or not. This
      in turn will allow targets to perform extra actions at specified points in the
      interface: add extra flags for some labels, extra work during finalization, etc.
      
      llvm-svn: 199174
      4a1a3606
  2. Jan 13, 2014
    • Cameron McInally's avatar
      Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp. · f0379fa4
      Cameron McInally authored
      llvm-svn: 199147
      f0379fa4
    • Juergen Ributzka's avatar
      [DAG] Refactor ReassociateOps - no functional change intended. · 6840282c
      Juergen Ributzka authored
      llvm-svn: 199146
      6840282c
    • Juergen Ributzka's avatar
      [DAG] Teach DAG to also reassociate vector operations · 7384405f
      Juergen Ributzka authored
      This commit teaches DAG to reassociate vector ops, which in turn enables
      constant folding of vector op chains that appear later on during custom lowering
      and DAG combine.
      
      Reviewed by Andrea Di Biagio
      
      llvm-svn: 199135
      7384405f
    • Andrew Trick's avatar
      Hide the pre-RA-sched= option. · 7daf6a45
      Andrew Trick authored
      This is a very confusing option for a feature that will go away.
      
      -enable-misched is exposed instead to help triage issues with the new
      scheduler.
      
      llvm-svn: 199133
      7daf6a45
    • Weiming Zhao's avatar
      Fix PR 18369: [Thumbv8] asserts due to inconsistent CPSR liveness of IT blocks · f66be56b
      Weiming Zhao authored
      The issue is caused when Post-RA scheduler reorders a bundle instruction
      (IT block). However, it only flips the CPSR liveness of the bundle instruction,
      leaves the instructions inside the bundle unchanged, which causes inconstancy and crashes
      Thumb2SizeReduction.cpp::ReduceMBB().
      
      llvm-svn: 199127
      f66be56b
    • Rafael Espindola's avatar
      Update getLazyBitcodeModule to use ErrorOr for error handling. · 5b6c1e8e
      Rafael Espindola authored
      llvm-svn: 199125
      5b6c1e8e
    • Andrea Di Biagio's avatar
      [AArch64] Fix assertion failure caused by an invalid comparison between APInt values. · 9bc0415c
      Andrea Di Biagio authored
      APInt only knows how to compare values with the same BitWidth and asserts
      in all other cases.
      
      With this fix, function PerformORCombine does not use the APInt equality
      operator if the APInt values returned by 'isConstantSplat' differ in BitWidth.
      In that case they are different and no comparison is needed.
      
      llvm-svn: 199119
      9bc0415c
    • Joerg Sonnenberger's avatar
      Fix indentation. · 808df672
      Joerg Sonnenberger authored
      llvm-svn: 199118
      808df672
    • Richard Sandiford's avatar
      [SystemZ] Optimize (sext (ashr (shl ...), ...)) · 32379b81
      Richard Sandiford authored
      ...into (ashr (shl (anyext X), ...), ...), which requires one fewer
      instruction.  The (anyext X) can sometimes be simplified too.
      
      I didn't do this in DAGCombiner because widening shifts isn't a win
      on all targets.
      
      llvm-svn: 199114
      32379b81
    • Tim Northover's avatar
      ARM: constrain Thumb LDRLIT pseudo-instructions to r0-r7. · 1328c1ae
      Tim Northover authored
      Previously we only used GPR for the destination placeholder in "ldr rD, [pc,
      incorrect codegen under the integrated assembler.
      
      This should fix both issues (which probably only affect MachO targets at the
      moment).
      
      rdar://problem/15800156
      
      llvm-svn: 199108
      1328c1ae
    • David Woodhouse's avatar
      [x86] Fix retq/retl handling in 64-bit mode · 4e033b0e
      David Woodhouse authored
      This finishes the job started in r198756, and creates separate opcodes for
      64-bit vs. 32-bit versions of the rest of the RET instructions too.
      
      LRETL/LRETQ are interesting... I can't see any justification for their
      existence in the SDM. There should be no 'LRETL' in 64-bit mode, and no
      need for a REX.W prefix for LRETQ. But this is what GAS does, and my
      Sandybridge CPU and an Opteron 6376 concur when tested as follows:
      
      asm __volatile__("pushq $0x1234\nmovq $0x33,%rax\nsalq $32,%rax\norq $1f,%rax\npushq %rax\nlretl $8\n1:");
      asm __volatile__("pushq $1234\npushq $0x33\npushq $1f\nlretq $8\n1:");
      asm __volatile__("pushq $0x33\npushq $1f\nlretq\n1:");
      asm __volatile__("pushq $0x1234\npushq $0x33\npushq $1f\nlretq $8\n1:");
      
      cf. PR8592 and commit r118903, which added LRETQ. I only added LRETIQ to
      match it.
      
      I don't quite understand how the Intel syntax parsing for ret
      instructions is working, despite r154468 allegedly fixing it. Aren't the
      explicitly sized 'retw', 'retd' and 'retq' supposed to work? I have at
      least made the 'lretq' work with (and indeed *require*) the 'q'.
      
      llvm-svn: 199106
      4e033b0e
    • Chandler Carruth's avatar
      [PM] Split DominatorTree into a concrete analysis result object which · 73523021
      Chandler Carruth authored
      can be used by both the new pass manager and the old.
      
      This removes it from any of the virtual mess of the pass interfaces and
      lets it derive cleanly from the DominatorTreeBase<> template. In turn,
      tons of boilerplate interface can be nuked and it turns into a very
      straightforward extension of the base DominatorTree interface.
      
      The old analysis pass is now a simple wrapper. The names and style of
      this split should match the split between CallGraph and
      CallGraphWrapperPass. All of the users of DominatorTree have been
      updated to match using many of the same tricks as with CallGraph. The
      goal is that the common type remains the resulting DominatorTree rather
      than the pass. This will make subsequent work toward the new pass
      manager significantly easier.
      
      Also in numerous places things became cleaner because I switched from
      re-running the pass (!!! mid way through some other passes run!!!) to
      directly recomputing the domtree.
      
      llvm-svn: 199104
      73523021
    • Elena Demikhovsky's avatar
      AVX-512: Embedded Rounding Control - encoding and printing · b19c9dc1
      Elena Demikhovsky authored
      Changed intrinsics for vrcp14/vrcp28 vrsqrt14/vrsqrt28 - aligned with GCC.
      
      llvm-svn: 199102
      b19c9dc1
    • Chandler Carruth's avatar
      [PM] Pull the generic graph algorithms and data structures for dominator · e509db41
      Chandler Carruth authored
      trees into the Support library.
      
      These are all expressed in terms of the generic GraphTraits and CFG,
      with no reliance on any concrete IR types. Putting them in support
      clarifies that and makes the fact that the static analyzer in Clang uses
      them much more sane. When moving the Dominators.h file into the IR
      library I claimed that this was the right home for it but not something
      I planned to work on. Oops.
      
      So why am I doing this? It happens to be one step toward breaking the
      requirement that IR verification can only be performed from inside of
      a pass context, which completely blocks the implementation of
      verification for the new pass manager infrastructure. Fixing it will
      also allow removing the concept of the "preverify" step (WTF???) and
      allow the verifier to cleanly flag functions which fail verification in
      a way that precludes even computing dominance information. Currently,
      that results in a fatal error even when you ask the verifier to not
      fatally error. It's awesome like that.
      
      The yak shaving will continue...
      
      llvm-svn: 199095
      e509db41
    • Tim Northover's avatar
      Revert "ReMat: fix overly cavalier attitude to sub-register indices" · 7fdd4857
      Tim Northover authored
      Very sorry, this was a premature patch that I still need to investigate and
      finish off (for some reason beyond me at the moment it doesn't actually fix the
      issue in all cases).
      
      This reverts commit r199091.
      
      llvm-svn: 199093
      7fdd4857
    • Tim Northover's avatar
      ReMat: fix overly cavalier attitude to sub-register indices · 59f8d4b4
      Tim Northover authored
      There are two attempted optimisations in reMaterializeTrivialDef, trying to
      avoid promoting the size of a register too much when rematerializing.
      Unfortunately, both appear to be flawed. First, we see if the original register
      would have worked, but this is inadequate. Consider:
      
          v1 = SOMETHING (v1 is QQ)
          v2:Q0 = COPY v1:Q1 (v1, v2 are QQ)
          ...
          uses of v2
      
      In this case even though v2 *could* be used directly as the output of
      SOMETHING, this would set the wrong bits of the QQ register involved. The
      correct rematerialization must be:
      
          v2:Q0_Q1 = SOMETHING (v2 promoted to QQQ)
          ...
          uses of v2:Q1_Q2
      
      For the second optimisation, if the correct remat is "v2:idx = SOMETHING" then
      we can't necessarily expect v2 itself to be valid for SOMETHING, but we do try
      to hunt for a class between v1 and v2 that works. Unfortunately, this is also
      wrong:
      
          v1 = SOMETHING (v1 is QQ)
          v2:Q0_Q1 = COPY v1 (v1 is QQ, v2 is QQQ)
          ...
          uses of v2 as a QQQ
      
      The canonical rematerialization here is "v2:Q0_Q1 = SOMETHING". However current
      logic would decide that v2 could be a QQ (no interest is taken in later uses).
      
      This patch, therefore, always accepts the widened register class without trying
      to be clever. Generally there is no penalty to this (e.g. in the common GR32 <
      GR64 case, expanding the width doesn't matter because it's not like you were
      going to do anything else with the high bits of a GR32 register). It can
      increase register pressure in cases like the ARM VFP regs though (multiple
      non-overlapping but equivalent subregisters). Hopefully this situation is rare
      enough that it won't matter.
      
      Unfortunately, no in-tree targets actually expose this as far as I can tell
      (there are so few isAsCheapAsAMove instructions for it to trigger on) so I've
      been unable to produce a test. It was exposed in our ARM64 SPEC tests though,
      and I will be adding a test there that we should be able to contribute
      soon(TM).
      
      llvm-svn: 199091
      59f8d4b4
    • Chandler Carruth's avatar
      [cleanup] Move the Dominators.h and Verifier.h headers into the IR · 5ad5f15c
      Chandler Carruth authored
      directory. These passes are already defined in the IR library, and it
      doesn't make any sense to have the headers in Analysis.
      
      Long term, I think there is going to be a much better way to divide
      these matters. The dominators code should be fully separated into the
      abstract graph algorithm and have that put in Support where it becomes
      obvious that evn Clang's CFGBlock's can use it. Then the verifier can
      manually construct dominance information from the Support-driven
      interface while the Analysis library can provide a pass which both
      caches, reconstructs, and supports a nice update API.
      
      But those are very long term, and so I don't want to leave the really
      confusing structure until that day arrives.
      
      llvm-svn: 199082
      5ad5f15c
    • Chandler Carruth's avatar
      Re-sort #include lines again, prior to moving headers around. · 07baed53
      Chandler Carruth authored
      llvm-svn: 199080
      07baed53
    • Chandler Carruth's avatar
      [PM] Wire up support for writing bitcode with new PM. · b7bdfd65
      Chandler Carruth authored
      This moves the old pass creation functionality to its own header and
      updates the callers of that routine. Then it adds a new PM supporting
      bitcode writer to the header file, and wires that up in the opt tool.
      A test is added that round-trips code into bitcode and back out using
      the new pass manager.
      
      llvm-svn: 199078
      b7bdfd65
    • Kevin Qin's avatar
      [AArch64 NEON] Add missing patterns for bitcast from or to v1f64 · cfef55d6
      Kevin Qin authored
      llvm-svn: 199070
      cfef55d6
    • Kevin Qin's avatar
      [AArch64 NEON] Add more scenarios to use perm instructions when lowering shuffle_vector · 21e8f1c4
      Kevin Qin authored
      This patch covered 2 more scenarios:
      
      1.  Two operands of shuffle_vector are the same, like
      %shuffle.i = shufflevector <8 x i8> %a, <8 x i8> %a, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
      
      2. One of operands is undef, like
      %shuffle.i = shufflevector <8 x i8> %a, <8 x i8> undef, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
      
      After this patch, perm instructions will have chance to be emitted instead of lots of INS.
      
      llvm-svn: 199069
      21e8f1c4
    • Saleem Abdulrasool's avatar
      correct target directive handling error handling · a6505ca4
      Saleem Abdulrasool authored
      The target specific parser should return `false' if the target AsmParser handles
      the directive, and `true' if the generic parser should handle the directive.
      Many of the target specific directive handlers would `return Error' which does
      not follow these semantics.  This change simply changes the target specific
      routines to conform to the semantis of the ParseDirective correctly.
      
      Conformance to the semantics improves diagnostics emitted for the invalid
      directives.  X86 is taken as a sample to ensure that multiple diagnostics are
      not presented for a single error.
      
      llvm-svn: 199068
      a6505ca4
  3. Jan 12, 2014
Loading