Skip to content
  1. Nov 19, 2014
  2. Nov 18, 2014
  3. Nov 17, 2014
    • Juergen Ributzka's avatar
      [SimplifyCFG] Make the value type of the hole check bitmask a power-of-2. · c9591e9b
      Juergen Ributzka authored
      When converting a switch to a lookup table we might have to generate a bitmaks
      to encode and check for holes in the original switch statement.
      
      The type of this mask depends on the number of switch statements, which can
      result in illegal types for pretty much all architectures.
      
      To avoid unnecessary type legalization and help FastISel this commit increases
      the size of the bitmask to next power-of-2 value when necessary.
      
      This fixes rdar://problem/18984639.
      
      llvm-svn: 222168
      c9591e9b
    • Chad Rosier's avatar
      [Reassociate] As the expression tree is rewritten make sure the operands are · bc0b869b
      Chad Rosier authored
      emitted in canonical form.
      
      llvm-svn: 222142
      bc0b869b
    • Chad Rosier's avatar
      [Reassociate] Canonicalize constants to RHS operand. · 9a1ac6e4
      Chad Rosier authored
      Fix a thinko where the RHS was already a constant.
      
      llvm-svn: 222139
      9a1ac6e4
    • Erik Eckstein's avatar
      Optimize switch lookup tables with linear mapping. · 105374fe
      Erik Eckstein authored
      This is a simple optimization for switch table lookup:
      It computes the output value directly with an (optional) mul and add if there is a linear mapping between index and output.
      Example:
      
      int f1(int x) {
        switch (x) {
          case 0: return 10;
          case 1: return 11;
          case 2: return 12;
          case 3: return 13;
        }
        return 0;
      }
      
      generates:
      
      define i32 @f1(i32 %x) #0 {
      entry:
        %0 = icmp ult i32 %x, 4
        br i1 %0, label %switch.lookup, label %return
      
      switch.lookup:
        %switch.offset = add i32 %x, 10
        ret i32 %switch.offset
      
      return:
        ret i32 0
      }
      
      llvm-svn: 222121
      105374fe
    • Rafael Espindola's avatar
      Add back r222061 with a fix. · a3b5b607
      Rafael Espindola authored
      This adds back r222061, but now calls initializePAEvalPass from the correct
      library to avoid link problems.
      
      Original message:
      
      Don't make assumptions about the name of private global variables.
      
      Private variables are can be renamed, so it is not reliable to make
      decisions on the name.
      
      The name is also dropped by the assembler before getting to the
      linker, so using the name causes a disconnect between how llvm makes a
      decision (var name) and how the linker makes a decision (section it is
      in).
      
      This patch changes one case where we were looking at the variable name to use
      the section instead.
      
      Test tuning by Michael Gottesman.
      
      llvm-svn: 222117
      a3b5b607
  4. Nov 15, 2014
  5. Nov 14, 2014
  6. Nov 13, 2014
  7. Nov 12, 2014
    • Ahmed Bougacha's avatar
      Add fortified (__*_chk) library functions to TLI (NFC) · 55a333d8
      Ahmed Bougacha authored
      One of them (__memcpy_chk) was already there, the others were checked
      by comparing function names.
      Note that the fortified libfuncs are now part of TLI, but are always
      available, because they aren't generated, only optimized into the
      non-checking versions.
      
      Differential Revision: http://reviews.llvm.org/D6179
      
      llvm-svn: 221817
      55a333d8
    • Jingyue Wu's avatar
      Disable indvar widening if arithmetics on the wider type are more expensive · 8a12cea5
      Jingyue Wu authored
      Summary:
      Reapply r221772. The old patch breaks the bot because the @indvar_32_bit test
      was run whether NVPTX was enabled or not.
      
      IndVarSimplify should not widen an indvar if arithmetics on the wider
      indvar are more expensive than those on the narrower indvar. For
      instance, although NVPTX64 treats i64 as a legal type, an ADD on i64 is
      twice as expensive as that on i32, because the hardware needs to
      simulate a 64-bit integer using two 32-bit integers.
      
      Split from D6188, and based on D6195 which adds NVPTXTargetTransformInfo.
      
      Fixes PR21148.
      
      Test Plan:
      Added @indvar_32_bit that verifies we do not widen an indvar if the arithmetics
      on the wider type are more expensive. This test is run only when NVPTX is
      enabled.
      
      Reviewers: jholewinski, eliben, meheff, atrick
      
      Reviewed By: atrick
      
      Subscribers: jholewinski, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D6196
      
      llvm-svn: 221799
      8a12cea5
    • Sanjay Patel's avatar
      remove function names from comments; NFC · 7777b50e
      Sanjay Patel authored
      llvm-svn: 221798
      7777b50e
    • Jingyue Wu's avatar
      Reverts r221772 which fails tests · a4827339
      Jingyue Wu authored
      llvm-svn: 221773
      a4827339
    • Jingyue Wu's avatar
      Disable indvar widening if arithmetics on the wider type are more expensive · 635a9b14
      Jingyue Wu authored
      Summary:
      IndVarSimplify should not widen an indvar if arithmetics on the wider
      indvar are more expensive than those on the narrower indvar. For
      instance, although NVPTX64 treats i64 as a legal type, an ADD on i64 is
      twice as expensive as that on i32, because the hardware needs to
      simulate a 64-bit integer using two 32-bit integers.
      
      Split from D6188, and based on D6195 which adds NVPTXTargetTransformInfo.
      
      Fixes PR21148.
      
      Test Plan:
      Added @indvar_32_bit that verifies we do not widen an indvar if the arithmetics
      on the wider type are more expensive.
      
      Reviewers: jholewinski, eliben, meheff, atrick
      
      Reviewed By: atrick
      
      Subscribers: jholewinski, llvm-commits
      
      Differential Revision: http://reviews.llvm.org/D6196
      
      llvm-svn: 221772
      635a9b14
    • Bill Schmidt's avatar
      [PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics · 72954784
      Bill Schmidt authored
      This patch enables the vec_vsx_ld and vec_vsx_st intrinsics for
      PowerPC, which provide programmer access to the lxvd2x, lxvw4x,
      stxvd2x, and stxvw4x instructions.
      
      New LLVM intrinsics are provided to represent these four instructions
      in IntrinsicsPowerPC.td.  These are patterned after the similar
      intrinsics for lvx and stvx (Altivec).  In PPCInstrVSX.td, these
      intrinsics are tied to the code gen patterns, with additional patterns
      to allow plain vanilla loads and stores to still generate these
      instructions.
      
      At -O1 and higher the intrinsics are immediately converted to loads
      and stores in InstCombineCalls.cpp.  This will open up more
      optimization opportunities while still allowing the correct
      instructions to be generated.  (Similar code exists for aligned
      Altivec loads and stores.)
      
      The new intrinsics are added to the code that checks for consecutive
      loads and stores in PPCISelLowering.cpp, as well as to
      PPCTargetLowering::getTgtMemIntrinsic().
      
      There's a new test to verify the correct instructions are generated.
      The loads and stores tend to be reordered, so the test just counts
      their number.  It runs at -O2, as it's not very effective to test this
      at -O0, when many unnecessary loads and stores are generated.
      
      I ended up having to modify vsx-fma-m.ll.  It turns out this test case
      is slightly unreliable, but I don't know a good way to prevent
      problems with it.  The xvmaddmdp instructions read and write the same
      register, which is one of the multiplicands.  Commutativity allows
      either to be chosen.  If the FMAs are reordered differently than
      expected by the test, the register assignment can be different as a
      result.  Hopefully this doesn't change often.
      
      There is a companion patch for Clang.
      
      llvm-svn: 221767
      72954784
    • Chad Rosier's avatar
      [Reassociate] Canonicalize negative constants out of expressions. · f53f0704
      Chad Rosier authored
      Add support for FDiv, which was regressed by the previous commit.
      
      llvm-svn: 221738
      f53f0704
    • Philip Reames's avatar
      Canonicalize an assume(load != null) into !nonnull metadata · 66c6de61
      Philip Reames authored
      We currently have two ways of informing the optimizer that the result of a load is never null: metadata and assume. This change converts the second in to the former. This avoids a need to implement optimizations using both forms.
      
      We should probably extend this basic idea to metadata of other forms; in particular, range metadata. We view is that assumes should be considered a "last resort" for when there isn't a more canonical way to represent something.
      
      Reviewed by: Hal
      Differential Revision: http://reviews.llvm.org/D5951
      
      llvm-svn: 221737
      66c6de61
    • Kostya Serebryany's avatar
      [asan] adding ShadowOffset64 for mips64, patch by Kumar Sukhani · 231bd088
      Kostya Serebryany authored
      llvm-svn: 221725
      231bd088
  8. Nov 11, 2014
Loading