Skip to content
  • Benjamin Kramer's avatar
    SimplifyCFG: Turn switches into sub+icmp+branch if possible. · f4ea1d5f
    Benjamin Kramer authored
    This makes the job of the later optzn passes easier, allowing the vast amount of
    icmp transforms to chew on it.
    
    We transform 840 switches in gcc.c, leading to a 16k byte shrink of the resulting
    binary on i386-linux.
    
    The testcase from README.txt now compiles into
      decl  %edi
      cmpl  $3, %edi
      sbbl  %eax, %eax
      andl  $1, %eax
      ret
    
    llvm-svn: 124724
    f4ea1d5f
Loading