Skip to content
  1. Dec 23, 2010
  2. Dec 22, 2010
  3. Dec 21, 2010
  4. Dec 20, 2010
  5. Dec 19, 2010
  6. Dec 18, 2010
  7. Dec 17, 2010
    • Owen Anderson's avatar
      Reapply r121905 (automatic synthesis of @llvm.sadd.with.overflow) with a fix... · 1294ea7d
      Owen Anderson authored
      Reapply r121905 (automatic synthesis of @llvm.sadd.with.overflow) with a fix for a bug that manifested itself
      on the DragonEgg self-host bot.  Unfortunately, the testcase is pretty messy and doesn't reduce well due to
      interactions with other parts of InstCombine.
      
      llvm-svn: 122072
      1294ea7d
    • Benjamin Kramer's avatar
      e5f49c4f
    • Chris Lattner's avatar
      improve switch formation to handle small range · d14b0f1d
      Chris Lattner authored
      comparisons formed by comparisons.  For example,
      this:
      
      void foo(unsigned x) {
        if (x == 0 || x == 1 || x == 3 || x == 4 || x == 6) 
          bar();
      }
      
      compiles into:
      
      _foo:                                   ## @foo
      ## BB#0:                                ## %entry
      	cmpl	$6, %edi
      	ja	LBB0_2
      ## BB#1:                                ## %entry
      	movl	%edi, %eax
      	movl	$91, %ecx
      	btq	%rax, %rcx
      	jb	LBB0_3
      
      instead of:
      
      _foo:                                   ## @foo
      ## BB#0:                                ## %entry
      	cmpl	$2, %edi
      	jb	LBB0_4
      ## BB#1:                                ## %switch.early.test
      	cmpl	$6, %edi
      	ja	LBB0_3
      ## BB#2:                                ## %switch.early.test
      	movl	%edi, %eax
      	movl	$88, %ecx
      	btq	%rax, %rcx
      	jb	LBB0_4
      
      This catches a bunch of cases in GCC, which look like this:
      
       %804 = load i32* @which_alternative, align 4, !tbaa !0
       %805 = icmp ult i32 %804, 2
       %806 = icmp eq i32 %804, 3
       %or.cond121 = or i1 %805, %806
       %807 = icmp eq i32 %804, 4
       %or.cond124 = or i1 %or.cond121, %807
       br i1 %or.cond124, label %.thread, label %808
      
      turning this into a range comparison.
      
      llvm-svn: 122045
      d14b0f1d
Loading