Skip to content
  1. Jan 25, 2014
    • Rafael Espindola's avatar
      This reverts commit r200064 and r200051. · 14d02fe5
      Rafael Espindola authored
      r200064 depends on r200051.
      
      r200051 is broken: I tries to replace .mips_hack_elf_flags, which is a good
      thing, but what it replaces it with is even worse.
      
      The new emitMipsELFFlags it adds corresponds to no assembly directive, is not
      marked as a hack and is not even printed to the .s file.
      
      The patch also introduces more uses of hasRawTextSupport.
      
      The correct way to remove .mips_hack_elf_flags is to have the mips target
      streamer handle the default flags (and command line options). That way the
      same code path is used for asm and obj. The streamer interface should *really*
      correspond to what is printed in the .s file.
      
      llvm-svn: 200078
      14d02fe5
    • Chandler Carruth's avatar
      [LPM] Conclude my immediate work by making the LoopVectorizer · 3aebcb99
      Chandler Carruth authored
      a FunctionPass. With this change the loop vectorizer no longer is a loop
      pass and can readily depend on function analyses. In particular, with
      this change we no longer have to form a loop pass manager to run the
      loop vectorizer which simplifies the entire pass management of LLVM.
      
      The next step here is to teach the loop vectorizer to leverage profile
      information through the profile information providing analysis passes.
      
      llvm-svn: 200074
      3aebcb99
    • Craig Topper's avatar
      Use isConcrete and getConcrete instead of using TypeVec directly. · 5f730e8e
      Craig Topper authored
      llvm-svn: 200071
      5f730e8e
    • Craig Topper's avatar
      Fix EnforceSmallerThan to check !hasVectorTypes on the other type instead of... · 6dbcb945
      Craig Topper authored
      Fix EnforceSmallerThan to check !hasVectorTypes on the other type instead of this type to force this type to be scalar.
      
      llvm-svn: 200070
      6dbcb945
    • Chandler Carruth's avatar
      [LPM] Make LCSSA a utility with a FunctionPass that applies it to all · 8765cf70
      Chandler Carruth authored
      the loops in a function, and teach LICM to work in the presance of
      LCSSA.
      
      Previously, LCSSA was a loop pass. That made passes requiring it also be
      loop passes and unable to depend on function analysis passes easily. It
      also caused outer loops to have a different "canonical" form from inner
      loops during analysis. Instead, we go into LCSSA form and preserve it
      through the loop pass manager run.
      
      Note that this has the same problem as LoopSimplify that prevents
      enabling its verification -- loop passes which run at the end of the loop
      pass manager and don't preserve these are valid, but the subsequent loop
      pass runs of outer loops that do preserve this pass trigger too much
      verification and fail because the inner loop no longer verifies.
      
      The other problem this exposed is that LICM was completely unable to
      handle LCSSA form. It didn't preserve it and it actually would give up
      on moving instructions in many cases when they were used by an LCSSA phi
      node. I've taught LICM to support detecting LCSSA-form PHI nodes and to
      hoist and sink around them. This may actually let LICM fire
      significantly more because we put everything into LCSSA form to rotate
      the loop before running LICM. =/ Now LICM should handle that fine and
      preserve it correctly. The down side is that LICM has to require LCSSA
      in order to preserve it. This is just a fact of life for LCSSA. It's
      entirely possible we should completely remove LCSSA from the optimizer.
      
      The test updates are essentially accomodating LCSSA phi nodes in the
      output of LICM, and the fact that we now completely sink every
      instruction in ashr-crash below the loop bodies prior to unrolling.
      
      With this change, LCSSA is computed only three times in the pass
      pipeline. One of them could be removed (and potentially a SCEV run and
      a separate LoopPassManager entirely!) if we had a LoopPass variant of
      InstCombine that ran InstCombine on the loop body but refused to combine
      away LCSSA PHI nodes. Currently, this also prevents loop unrolling from
      being in the same loop pass manager is rotate, LICM, and unswitch.
      
      There is one thing that I *really* don't like -- preserving LCSSA in
      LICM is quite expensive. We end up having to re-run LCSSA twice for some
      loops after LICM runs because LICM can undo LCSSA both in the current
      loop and the parent loop. I don't really see good solutions to this
      other than to completely move away from LCSSA and using tools like
      SSAUpdater instead.
      
      llvm-svn: 200067
      8765cf70
    • Rafael Espindola's avatar
      Remove an easy use of EmitRawText from PPC. · 6b9ee9bc
      Rafael Espindola authored
      This makes lib/Target/PowerPC EmitRawText free.
      
      llvm-svn: 200065
      6b9ee9bc
    • Jack Carter's avatar
      [Mips] Move 2 test cases from MC to CodeGen. · 8150e141
      Jack Carter authored
      No code changes. Just reassignment of test case files.
      
      llvm-svn: 200064
      8150e141
    • Juergen Ributzka's avatar
      Revert "Revert "Add Constant Hoisting Pass" (r200034)" · f26beda7
      Juergen Ributzka authored
      This reverts commit r200058 and adds the using directive for
      ARMTargetTransformInfo to silence two g++ overload warnings.
      
      llvm-svn: 200062
      f26beda7
    • Reid Kleckner's avatar
      Fix llvm-dis to print the inalloca bit on allocas. · 2084403a
      Reid Kleckner authored
      llvm-svn: 200059
      2084403a
    • Hans Wennborg's avatar
      Revert "Add Constant Hoisting Pass" (r200034) · 4d67a2e8
      Hans Wennborg authored
      This commit caused -Woverloaded-virtual warnings. The two new
      TargetTransformInfo::getIntImmCost functions were only added to the superclass,
      and to the X86 subclass. The other targets were not updated, and the
      warning highlighted this by pointing out that e.g. ARMTTI::getIntImmCost was
      hiding the two new getIntImmCost variants.
      
      We could pacify the warning by adding "using TargetTransformInfo::getIntImmCost"
      to the various subclasses, or turning it off, but I suspect that it's wrong to
      leave the functions unimplemnted in those targets. The default implementations
      return TCC_Free, which I don't think is right e.g. for ARM.
      
      llvm-svn: 200058
      4d67a2e8
    • Mark Seaborn's avatar
      llvm-objdump: Some style cleanups to follow LLVM coding style · eb03ac50
      Mark Seaborn authored
      Rename "ec" to "EC", and rename some iterators.
      
      Then fix whitespace using clang-format-diff.
      
      (As requested in http://llvm-reviews.chandlerc.com/D2559)
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2594
      
      llvm-svn: 200053
      eb03ac50
    • Jack Carter's avatar
      [Mips] TargetStreamer ELF flag Support for default and commandline options. · ca2ae49d
      Jack Carter authored
      This patch uses a common MipsTargetSteamer interface for both 
      MipsAsmPrinter and MipsAsmParser for recording default and commandline
      driven directives that affect ELF header flags.
      
      It has been noted that the .ll tests affected by this patch belong in
      test/Codegen/Mips. I will move them in a separate patch.
      
      Also, a number of directives do not get expressed by AsmPrinter in the 
      resultant .s assembly such as setting the correct ASI. I have noted this
      in the tests and they will be addressed in later patches.
      
      llvm-svn: 200051
      ca2ae49d
    • Aaron Ballman's avatar
      Typo fix. · d98a7099
      Aaron Ballman authored
      llvm-svn: 200050
      d98a7099
  2. Jan 24, 2014
    • Ana Pazos's avatar
      [AArch64] Removed unused i8 type from FPR8 register class. · cd3b9f76
      Ana Pazos authored
      The i8 type is not registered with any register class.
      This causes a segmentation fault in MachineLICM::getRegisterClassIDAndCost.
      
      The code selects the first type associated with register class FPR8,
      which happens to be i8.
      It uses this type (i8) to get the representative class pointer, which is 0.
      It then uses this pointer to access a field, resulting in segmentation fault.
      
      Since i8 type is not being used for printing any neon instruction
      we can safely remove it.
      
      llvm-svn: 200046
      cd3b9f76
    • Rafael Espindola's avatar
      Fix c++03 build. · 09419ad6
      Rafael Espindola authored
      llvm-svn: 200042
      09419ad6
    • Rafael Espindola's avatar
      Make ObjectFile ownership of the MemoryBuffer optional. · afcc3df7
      Rafael Espindola authored
      This allows llvm-ar to mmap the input files only once.
      
      llvm-svn: 200040
      afcc3df7
    • Rui Ueyama's avatar
      Support/COFF: Fix PEHeader struct, and define PE32Header as its alias. · fa5900a6
      Rui Ueyama authored
      This change does not affect anything because everybody seems to be using
      Object/COFF.h instead. But the definition is not for PE32 but for PE32+,
      so fix it anyway.
      
      llvm-svn: 200038
      fa5900a6
    • Craig Topper's avatar
      3f9978e6
    • Craig Topper's avatar
      Replace tablegen uses of EVT with MVT. Add isOverloaded() to MVT to... · 8561de90
      Craig Topper authored
      Replace tablegen uses of EVT with MVT. Add isOverloaded() to MVT to facilitate. Remove TGValueTypes.cpp since its unused now (and may have been before).
      
      llvm-svn: 200036
      8561de90
    • Juergen Ributzka's avatar
      Add Constant Hoisting Pass · 4f3df4ad
      Juergen Ributzka authored
      Retry commit r200022 with a fix for the build bot errors. Constant expressions
      have (unlike instructions) module scope use lists and therefore may have users
      in different functions. The fix is to simply ignore these out-of-function uses.
      
      llvm-svn: 200034
      4f3df4ad
    • Hal Finkel's avatar
      Fix DAGCombiner::GatherAllAliases to account for non-chain dependencies · 51a98380
      Hal Finkel authored
      DAGCombiner::GatherAllAliases, which is only used when AA used is enabled
      during DAGCombine, had a fundamentally incorrect assumption for which this
      change compensates. GatherAllAliases, which is used to find aliasing
      predecessor chain nodes (so that a better chain can be selected for a load or
      store to enable subsequent optimizations) assumed that walking up the chain
      would always catch all possibly-aliasing loads and stores. This is not true: To
      really find all aliases, we also need to search for aliases through the value
      operand of a store, etc.  Consider the following situation:
      
        Token1 = ...
        L1 = load Token1, %52
        S1 = store Token1, L1, %51
        L2 = load Token1, %52+8
        S2 = store Token1, L2, %51+8
        Token2 = Token(S1, S2)
        L3 = load Token2, %53
        S3 = store Token2, L3, %52
        L4 = load Token2, %53+8
        S4 = store Token2, L4, %52+8
      
      If we search for aliases of S3 (which loads address %52), and we look only
      through the chain, then we'll miss the trivial dependence on L1 (which loads
      from %52). We then might change all loads and stores to use Token1 as their
      chain operand, which could result in copying %53 into %52 before copying
      %52 into %51 (which should happen first).
      
      The problem is, however, that searching for such data dependencies can become
      expensive, and the cost is not directly related to the chain depth. Instead,
      we'll rule out such configurations by insisting that we've visited all chain
      users (except for users of the original chain, which is not necessary).  When
      doing this, we need to look through nodes we don't care about (otherwise,
      things like register copies will interfere with trivial use cases).
      
      Unfortunately, I don't have a small test case for this problem. Creating the
      underlying situation is not hard (a pair of memcpys will do it), but arranging
      for the default instruction schedule to be incorrect is very fragile.
      
      This unbreaks self hosting on PPC64 when using
      -mllvm -combiner-global-alias-analysis -mllvm -combiner-alias-analysis.
      
      llvm-svn: 200033
      51a98380
    • Bill Wendling's avatar
      Verify that attributes are not lost during linking. · 3c68b0d4
      Bill Wendling authored
      We don't want to lose attributes when a function decl without them is merged
      with a function decl that has them.
      PR2382
      
      llvm-svn: 200030
      3c68b0d4
    • Benjamin Kramer's avatar
      InstCombine: Don't try to use aggregate elements of ConstantExprs. · 09b0f88a
      Benjamin Kramer authored
      PR18600.
      
      llvm-svn: 200028
      09b0f88a
    • Lang Hames's avatar
      Add a testcase for the changes in r199938. · c63c52e0
      Lang Hames authored
      <rdar://problem/15611947>
      
      llvm-svn: 200027
      c63c52e0
    • Juergen Ributzka's avatar
      Revert "Add Constant Hoisting Pass" · 50e7e80d
      Juergen Ributzka authored
      This reverts commit r200022 to unbreak the build bots.
      
      llvm-svn: 200024
      50e7e80d
    • Hal Finkel's avatar
      Restrict FindBetterChain DAG combines to unindexed nodes · ccc18e13
      Hal Finkel authored
      These transformations obviously won't work for indexed (pre/post-inc) loads and
      stores. In practice, I'm not sure there is any benefit to enabling them for
      indexed nodes because other transformations that these might enable likely also
      won't handle indexed nodes.
      
      I don't have an in-tree test case that hits this problem, but an upcoming bug
      fix will make it much more likely.
      
      llvm-svn: 200023
      ccc18e13
    • Juergen Ributzka's avatar
      Add Constant Hoisting Pass · 38b67d0c
      Juergen Ributzka authored
      This pass identifies expensive constants to hoist and coalesces them to
      better prepare it for SelectionDAG-based code generation. This works around the
      limitations of the basic-block-at-a-time approach.
      
      First it scans all instructions for integer constants and calculates its
      cost. If the constant can be folded into the instruction (the cost is
      TCC_Free) or the cost is just a simple operation (TCC_BASIC), then we don't
      consider it expensive and leave it alone. This is the default behavior and
      the default implementation of getIntImmCost will always return TCC_Free.
      
      If the cost is more than TCC_BASIC, then the integer constant can't be folded
      into the instruction and it might be beneficial to hoist the constant.
      Similar constants are coalesced to reduce register pressure and
      materialization code.
      
      When a constant is hoisted, it is also hidden behind a bitcast to force it to
      be live-out of the basic block. Otherwise the constant would be just
      duplicated and each basic block would have its own copy in the SelectionDAG.
      The SelectionDAG recognizes such constants as opaque and doesn't perform
      certain transformations on them, which would create a new expensive constant.
      
      This optimization is only applied to integer constants in instructions and
      simple (this means not nested) constant cast experessions. For example:
      %0 = load i64* inttoptr (i64 big_constant to i64*)
      
      Reviewed by Eric
      
      llvm-svn: 200022
      38b67d0c
    • Juergen Ributzka's avatar
      3e752e7a
    • Juergen Ributzka's avatar
      Doxify comments · 63e5c1fd
      Juergen Ributzka authored
      llvm-svn: 200020
      63e5c1fd
    • Alp Toker's avatar
      Fix known typos · cb402911
      Alp Toker authored
      Sweep the codebase for common typos. Includes some changes to visible function
      names that were misspelt.
      
      llvm-svn: 200018
      cb402911
    • Alp Toker's avatar
      Report lli remote IO errors consistently · ad6aa47c
      Alp Toker authored
      This enables IO error reports in both the child and server processes.
      
      The scheme still isn't entirely satisfactory and output is jumbled but it beats
      having no output at all. This will hopefully unblock ARM support (PR18057).
      
      llvm-svn: 200017
      ad6aa47c
    • Benjamin Kramer's avatar
      5e1794ee
    • Rafael Espindola's avatar
      Unify duplicated functions. · e7583756
      Rafael Espindola authored
      llvm-svn: 200014
      e7583756
    • Rafael Espindola's avatar
      Don't use "llc -filetype=obj" now that the codepath is the same. · f8f15bf6
      Rafael Espindola authored
      r200011 remove the special codepaths in MC for inline asm, so we can now test
      all the logic with just llc + llvm-mc.
      
      llvm-svn: 200013
      f8f15bf6
    • Rafael Espindola's avatar
      Move emitInlineAsmEnd to the AsmPrinter interface. · 65fd0a8c
      Rafael Espindola authored
      There is no inline asm in a .s file. Therefore, there should be no logic to
      handle it in the streamer. Inline asm only exists in bitcode files, so the
      logic can live in the (long misnamed) AsmPrinter class.
      
      llvm-svn: 200011
      65fd0a8c
    • NAKAMURA Takumi's avatar
      DWARFContext: Fix possible memory leak since r198908. · 7409e843
      NAKAMURA Takumi authored
      llvm-svn: 200000
      7409e843
    • NAKAMURA Takumi's avatar
      llvm/projects/CMakeLists.txt: Add dragonegg. · 480132f0
      NAKAMURA Takumi authored
      llvm-svn: 199995
      480132f0
    • Eric Christopher's avatar
      Revert "Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a" · cf48ade8
      Eric Christopher authored
      in order to fix the cygwin/mingw bots.
      
      This reverts commit r199990.
      
      llvm-svn: 199991
      cf48ade8
    • Eric Christopher's avatar
      Use DW_AT_high_pc and DW_AT_low_pc for the high and low pc for a · c528858c
      Eric Christopher authored
      compile unit. Make these relocations on the platforms that need
      relocations and add a routine to ensure that we don't put the
      addresses in an offset table for split dwarf.
      
      llvm-svn: 199990
      c528858c
    • Kevin Qin's avatar
      [AArch64 NEON] Fix a bug in implementing register copy bwtween FPR16. · 21cd2152
      Kevin Qin authored
      llvm-svn: 199978
      21cd2152
Loading