Skip to content
  1. Aug 07, 2012
    • Jakob Stoklund Olesen's avatar
      Add trace accessor methods, implement primitive if-conversion heuristic. · 75d9d515
      Jakob Stoklund Olesen authored
      Compare the critical paths of the two traces through an if-conversion
      candidate. If the difference is larger than the branch brediction
      penalty, reject the if-conversion. If would never pay.
      
      llvm-svn: 161433
      75d9d515
    • Rafael Espindola's avatar
      The dominance computation already has logic for computing if an edge dominates · 59564079
      Rafael Espindola authored
      a use or a BB, but it is inline in the handling of the invoke instruction.
      
      This patch refactors it so that it can be used in other cases. For example, in
      
      define i32 @f(i32 %x) {
      bb0:
        %cmp = icmp eq i32 %x, 0
        br i1 %cmp, label %bb2, label %bb1
      bb1:
        br label %bb2
      bb2:
        %cond = phi i32 [ %x, %bb0 ], [ 0, %bb1 ]
        %foo = add i32 %cond, %x
        ret i32 %foo
      }
      
      GVN should be able to replace %x with 0 in any use that is dominated by the
      true edge out of bb0. In the above example the only such use is the one in
      the phi.
      
      llvm-svn: 161429
      59564079
    • Hal Finkel's avatar
      Add a comment about mftb vs. mfspr on PPC. · 895a5f5d
      Hal Finkel authored
      Thanks to Alex Rosenberg for the suggestion.
      
      llvm-svn: 161428
      895a5f5d
    • Alexey Samsonov's avatar
      Fix the representation of debug line table in DebugInfo LLVM library, · 947228c4
      Alexey Samsonov authored
      and "instruction address -> file/line" lookup.
      
      Instead of plain collection of rows, debug line table for compilation unit is now
      treated as the number of row ranges, describing sequences (series of contiguous machine
      instructions). The sequences are not always listed in the order of increasing
      address, so previously used std::lower_bound() sometimes produced wrong results.
      Now the instruction address lookup consists of two stages: finding the correct
      sequence, and searching for address in range of rows for this sequence.
      
      llvm-svn: 161414
      947228c4
    • Benjamin Kramer's avatar
      PR13095: Give an inline cost bonus to functions using byval arguments. · c99d0e91
      Benjamin Kramer authored
      We give a bonus for every argument because the argument setup is not needed
      anymore when the function is inlined. With this patch we interpret byval
      arguments as a compact representation of many arguments. The byval argument
      setup is implemented in the backend as an inline memcpy, so to model the
      cost as accurately as possible we take the number of pointer-sized elements
      in the byval argument and give a bonus of 2 instructions for every one of
      those. The bonus is capped at 8 elements, which is the number of stores
      at which the x86 backend switches from an expanded inline memcpy to a real
      memcpy. It would be better to use the real memcpy threshold from the backend,
      but it's not available via TargetData.
      
      This change brings the performance of c-ray in line with gcc 4.7. The included
      test case tries to reproduce the c-ray problem to catch regressions for this
      benchmark early, its performance is dominated by the inline decision of a
      specific call.
      
      This only has a small impact on most code, more on x86 and arm than on x86_64
      due to the way the ABI works. When building LLVM for x86 it gives a small
      inline cost boost to virtually any function using StringRef or STL allocators,
      but only a 0.01% increase in overall binary size. The size of gcc compiled by
      clang actually shrunk by a couple bytes with this patch applied, but not
      significantly.
      
      llvm-svn: 161413
      c99d0e91
    • Chandler Carruth's avatar
      Fix PR13412, a nasty miscompile due to the interleaved · 2f6cf488
      Chandler Carruth authored
      instsimplify+inline strategy.
      
      The crux of the problem is that instsimplify was reasonably relying on
      an invariant that is true within any single function, but is no longer
      true mid-inline the way we use it. This invariant is that an argument
      pointer != a local (alloca) pointer.
      
      The fix is really light weight though, and allows instsimplify to be
      resiliant to these situations: when checking the relation ships to
      function arguments, ensure that the argumets come from the same
      function. If they come from different functions, then none of these
      assumptions hold. All credit to Benjamin Kramer for coming up with this
      clever solution to the problem.
      
      llvm-svn: 161410
      2f6cf488
    • Chandler Carruth's avatar
      Add a much more conservative strategy for aligning branch targets. · 881d0a79
      Chandler Carruth authored
      Previously, MBP essentially aligned every branch target it could. This
      bloats code quite a bit, especially non-looping code which has no real
      reason to prefer aligned branch targets so heavily.
      
      As Andy said in review, it's still a bit odd to do this without a real
      cost model, but this at least has much more plausible heuristics.
      
      Fixes PR13265.
      
      llvm-svn: 161409
      881d0a79
    • Manman Ren's avatar
      MachineCSE: Update the heuristics for isProfitableToCSE. · cb36b8c2
      Manman Ren authored
      If the result of a common subexpression is used at all uses of the candidate
      expression, CSE should not increase the live range of the common subexpression.
      
      rdar://11393714 and rdar://11819721
      
      llvm-svn: 161396
      cb36b8c2
    • Bill Wendling's avatar
      Revert r161371. Removing the 'const' before Type is a "good thing". · 0acd0c0a
      Bill Wendling authored
      --- Reverse-merging r161371 into '.':
      U    include/llvm/Target/TargetData.h
      U    lib/Target/TargetData.cpp
      
      llvm-svn: 161394
      0acd0c0a
    • Jack Carter's avatar
      The define for 64 bit sign extension neglected to · f4946cfb
      Jack Carter authored
      initialize fields of the class that it used.
      
      The result was nonsense code.
      
      Before:
      0000000000000000 <foo>:
         0:    00441100     0x441100
         4:    03e00008     jr    ra
         8:    00000000     nop
      
      After:
      0000000000000000 <foo>:
         0:    00041000     sll    v0,a0,0x0
         4:    03e00008     jr    ra
         8:    00000000     nop 
      
      llvm-svn: 161377
      f4946cfb
    • Bill Wendling's avatar
      654cd4aa
    • Andrew Trick's avatar
      Allow x86 subtargets to use the GenericModel defined in X86Schedule.td. · e0c83b1f
      Andrew Trick authored
      This allows codegen passes to query properties like
      InstrItins->SchedModel->IssueWidth. It also ensure's that
      computeOperandLatency returns the X86 defaults for loads and "high
      latency ops". This should have no significant impact on existing
      schedulers because X86 defaults happen to be the same as global
      defaults.
      
      llvm-svn: 161370
      e0c83b1f
    • Jack Carter's avatar
      Mips relocation R_MIPS_64 relocates a 64 bit double word. · 4c58381c
      Jack Carter authored
      I hit this in a very large program (spirit.cpp), but 
      have not figured out how to make a small make check
      test for it.
      
      llvm-svn: 161366
      4c58381c
    • Jack Carter's avatar
      The Mips64InstrInfo.td definitions DynAlloc64 LEA_ADDiu64 · 612c6631
      Jack Carter authored
      were using a class defined for 32 bit instructions and 
      thus the instruction was for addiu instead of daddiu.
      
      This was corrected by adding the instruction opcode as a 
      field in the  base class to be filled in by the defs.
      
      llvm-svn: 161359
      612c6631
  2. Aug 06, 2012
  3. Aug 05, 2012
  4. Aug 04, 2012
  5. Aug 03, 2012
    • Bob Wilson's avatar
      Try to reduce the compile time impact of r161232. · 871701c6
      Bob Wilson authored
      The previous change caused fast isel to not attempt handling any calls to
      builtin functions.  That included things like "printf" and caused some
      noticable regressions in compile time.  I wanted to avoid having fast isel
      keep a separate list of functions that had to be kept in sync with what the
      code in SelectionDAGBuilder.cpp was handling.  I've resolved that here by
      moving the list into TargetLibraryInfo.  This is somewhat redundant in
      SelectionDAGBuilder but it will ensure that we keep things consistent.
      
      llvm-svn: 161263
      871701c6
    • Bob Wilson's avatar
      Fix memcmp code-gen to honor -fno-builtin. · fa59485b
      Bob Wilson authored
      I noticed that SelectionDAGBuilder::visitCall was missing a check for memcmp
      in TargetLibraryInfo, so that it would use custom code for memcmp calls even
      with -fno-builtin.  I also had to add a new -disable-simplify-libcalls option
      to llc so that I could write a test for this.
      
      llvm-svn: 161262
      fa59485b
    • Jakob Stoklund Olesen's avatar
      Completely eliminate VNInfo flags. · daae19f7
      Jakob Stoklund Olesen authored
      The 'unused' state of a value number can be represented as an invalid
      def SlotIndex. This also exposed code that shouldn't have been looking
      at unused value VNInfos.
      
      llvm-svn: 161258
      daae19f7
    • Jakob Stoklund Olesen's avatar
      Fix a couple of loops that were processing unused value numbers. · 21809385
      Jakob Stoklund Olesen authored
      Unused VNInfos should be left alone. Their def SlotIndex doesn't point
      to anything.
      
      llvm-svn: 161257
      21809385
    • Matt Beaumont-Gay's avatar
      Silence unused variable warning in -asserts build · aaba08d5
      Matt Beaumont-Gay authored
      llvm-svn: 161256
      aaba08d5
    • Jakob Stoklund Olesen's avatar
      Eliminate the VNInfo::hasPHIKill() flag. · 9f565e19
      Jakob Stoklund Olesen authored
      The only real user of the flag was removeCopyByCommutingDef(), and it
      has been switched to LiveIntervals::hasPHIKill().
      
      All the code changed by this patch was only concerned with computing and
      propagating the flag.
      
      llvm-svn: 161255
      9f565e19
Loading