Skip to content
  1. Apr 10, 2004
    • Chris Lattner's avatar
      Simplify code a bit, and use alias analysis to allow us to delete unused · cfa1adcd
      Chris Lattner authored
      call and invoke instructions that are known to not write to memory.
      
      llvm-svn: 12807
      cfa1adcd
    • Chris Lattner's avatar
      Implement select.ll:test12* · 56e4d3d8
      Chris Lattner authored
      This transforms code like this:
      
         %C = or %A, %B
         %D = select %cond, %C, %A
      into:
         %C = select %cond, %B, 0
         %D = or %A, %C
      
      Since B is often a constant, the select can often be eliminated.  In any case,
      this reduces the usage count of A, allowing subsequent optimizations to happen.
      
      This xform applies when the operator is any of:
        add, sub, mul, or, xor, and, shl, shr
      
      llvm-svn: 12800
      56e4d3d8
    • Chris Lattner's avatar
      Fold code like: · 0aa56564
      Chris Lattner authored
        if (C)
          V1 |= V2;
      
      into:
        Vx = V1 | V2;
        V1 = select C, V1, Vx
      
      when the expression can be evaluated unconditionally and is *cheap* to
      execute.  This limited form of if conversion is quite handy in lots of cases.
      For example, it turns this testcase into straight-line code:
      
      int in0 ; int in1 ; int in2 ; int in3 ;
      int in4 ; int in5 ; int in6 ; int in7 ;
      int in8 ; int in9 ; int in10; int in11;
      int in12; int in13; int in14; int in15;
      long output;
      
      void mux(void) {
        output =
            (in0   ?  0x00000001 : 0) | (in1   ?  0x00000002 : 0) |
            (in2   ?  0x00000004 : 0) | (in3   ?  0x00000008 : 0) |
            (in4   ?  0x00000010 : 0) | (in5   ?  0x00000020 : 0) |
            (in6   ?  0x00000040 : 0) | (in7   ?  0x00000080 : 0) |
            (in8   ?  0x00000100 : 0) | (in9   ?  0x00000200 : 0) |
            (in10  ?  0x00000400 : 0) | (in11  ?  0x00000800 : 0) |
            (in12  ?  0x00001000 : 0) | (in13  ?  0x00002000 : 0) |
            (in14  ?  0x00004000 : 0) | (in15  ?  0x00008000 : 0) ;
      }
      
      llvm-svn: 12798
      0aa56564
  2. Apr 09, 2004
  3. Apr 08, 2004
  4. Apr 07, 2004
Loading