Skip to content
  1. Apr 30, 2011
    • Benjamin Kramer's avatar
      InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B. · 9aa91b1f
      Benjamin Kramer authored
      This obviously helps a lot if the division would be turned into a libcall
      (think i64 udiv on i386), but div is also one of the few remaining instructions
      on modern CPUs that become more expensive when the bitwidth gets bigger.
      
      This also helps register pressure on i386 when dividing chars, divb needs
      two 8-bit parts of a 16 bit register as input where divl uses two registers.
      
      int foo(unsigned char a) { return a/10; }
      int bar(unsigned char a, unsigned char b) { return a/b; }
      
      compiles into (x86_64)
      _foo:
        imull $205, %edi, %eax
        shrl  $11, %eax
        ret
      _bar:
        movzbl        %dil, %eax
        divb  %sil, %al
        movzbl        %al, %eax
        ret
      
      llvm-svn: 130615
      9aa91b1f
  2. Nov 07, 2009
    • Chris Lattner's avatar
      make instcombine only rewrite a chain of computation · c77d24b7
      Chris Lattner authored
      (eliminating some extends) if the new type of the
      computation is legal or if both the source and dest
      are illegal.  This prevents instcombine from changing big
      chains of computation into i64 on 32-bit targets for 
      example.
      
      llvm-svn: 86398
      c77d24b7
  3. Sep 11, 2009
  4. Sep 09, 2009
  5. Sep 08, 2009
  6. Jul 14, 2009
Loading