Skip to content
  1. Jan 15, 2011
    • Chris Lattner's avatar
      Now that instruction optzns can update the iterator as they go, we can · 1b93be50
      Chris Lattner authored
      have objectsize folding recursively simplify away their result when it
      folds.  It is important to catch this here, because otherwise we won't
      eliminate the cross-block values at isel and other times.
      
      llvm-svn: 123524
      1b93be50
    • Chris Lattner's avatar
      make the current instruction iterator an ivar, allowing xforms that · 7a277144
      Chris Lattner authored
      potentially invalidate it (like inline asm lowering) to be sunk into
      their proper place, cleaning up a ton of code.
      
      llvm-svn: 123523
      7a277144
    • Chris Lattner's avatar
      implement an instcombine xform that canonicalizes casts outside of and-with-constant operations. · 9c10d587
      Chris Lattner authored
      This fixes rdar://8808586 which observed that we used to compile:
      
      
      union xy {
              struct x { _Bool b[15]; } x;
              __attribute__((packed))
              struct y {
                      __attribute__((packed)) unsigned long b0to7;
                      __attribute__((packed)) unsigned int b8to11;
                      __attribute__((packed)) unsigned short b12to13;
                      __attribute__((packed)) unsigned char b14;
              } y;
      };
      
      struct x
      foo(union xy *xy)
      {
              return xy->x;
      }
      
      into:
      
      _foo:                                   ## @foo
      	movq	(%rdi), %rax
      	movabsq	$1095216660480, %rcx    ## imm = 0xFF00000000
      	andq	%rax, %rcx
      	movabsq	$-72057594037927936, %rdx ## imm = 0xFF00000000000000
      	andq	%rax, %rdx
      	movzbl	%al, %esi
      	orq	%rdx, %rsi
      	movq	%rax, %rdx
      	andq	$65280, %rdx            ## imm = 0xFF00
      	orq	%rsi, %rdx
      	movq	%rax, %rsi
      	andq	$16711680, %rsi         ## imm = 0xFF0000
      	orq	%rdx, %rsi
      	movl	%eax, %edx
      	andl	$-16777216, %edx        ## imm = 0xFFFFFFFFFF000000
      	orq	%rsi, %rdx
      	orq	%rcx, %rdx
      	movabsq	$280375465082880, %rcx  ## imm = 0xFF0000000000
      	movq	%rax, %rsi
      	andq	%rcx, %rsi
      	orq	%rdx, %rsi
      	movabsq	$71776119061217280, %r8 ## imm = 0xFF000000000000
      	andq	%r8, %rax
      	orq	%rsi, %rax
      	movzwl	12(%rdi), %edx
      	movzbl	14(%rdi), %esi
      	shlq	$16, %rsi
      	orl	%edx, %esi
      	movq	%rsi, %r9
      	shlq	$32, %r9
      	movl	8(%rdi), %edx
      	orq	%r9, %rdx
      	andq	%rdx, %rcx
      	movzbl	%sil, %esi
      	shlq	$32, %rsi
      	orq	%rcx, %rsi
      	movl	%edx, %ecx
      	andl	$-16777216, %ecx        ## imm = 0xFFFFFFFFFF000000
      	orq	%rsi, %rcx
      	movq	%rdx, %rsi
      	andq	$16711680, %rsi         ## imm = 0xFF0000
      	orq	%rcx, %rsi
      	movq	%rdx, %rcx
      	andq	$65280, %rcx            ## imm = 0xFF00
      	orq	%rsi, %rcx
      	movzbl	%dl, %esi
      	orq	%rcx, %rsi
      	andq	%r8, %rdx
      	orq	%rsi, %rdx
      	ret
      
      We now compile this into:
      
      _foo:                                   ## @foo
      ## BB#0:                                ## %entry
      	movzwl	12(%rdi), %eax
      	movzbl	14(%rdi), %ecx
      	shlq	$16, %rcx
      	orl	%eax, %ecx
      	shlq	$32, %rcx
      	movl	8(%rdi), %edx
      	orq	%rcx, %rdx
      	movq	(%rdi), %rax
      	ret
      
      A small improvement :-)
      
      llvm-svn: 123520
      9c10d587
    • Chris Lattner's avatar
      one more instcombine variant that is needed to work with future changes, · e20dd530
      Chris Lattner authored
      no functionality change currently.
      
      llvm-svn: 123517
      e20dd530
    • Chris Lattner's avatar
      fix typo · 497459d5
      Chris Lattner authored
      llvm-svn: 123516
      497459d5
    • Chris Lattner's avatar
      Catch ~x < cst just like ~x < ~y, we currently handle this through · f3c4eeff
      Chris Lattner authored
      means that are about to disappear.
      
      llvm-svn: 123515
      f3c4eeff
    • Chris Lattner's avatar
      reduce indentation · 311aa63c
      Chris Lattner authored
      llvm-svn: 123514
      311aa63c
    • Chris Lattner's avatar
      Generalize LoadAndStorePromoter a bit and switch LICM · b68ec5c3
      Chris Lattner authored
      to use it.
      
      llvm-svn: 123501
      b68ec5c3
  2. Jan 14, 2011
  3. Jan 13, 2011
    • Bob Wilson's avatar
      Fix whitespace. · 328e91bb
      Bob Wilson authored
      llvm-svn: 123396
      328e91bb
    • Bob Wilson's avatar
      Check for empty structs, and for consistency, zero-element arrays. · c8056a95
      Bob Wilson authored
      llvm-svn: 123383
      c8056a95
    • Bob Wilson's avatar
      Extend SROA to handle arrays accessed as homogeneous structs and vice versa. · 08713d3c
      Bob Wilson authored
      This is a minor extension of SROA to handle a special case that is
      important for some ARM NEON operations.  Some of the NEON intrinsics
      return multiple values, which are handled as struct types containing
      multiple elements of the same vector type.  The corresponding return
      types declared in the arm_neon.h header have equivalent arrays.  We
      need SROA to recognize that it can split up those arrays and structs
      into separate vectors, even though they are not always accessed with
      the same type.  SROA already handles loads and stores of an entire
      alloca by using insertvalue/extractvalue to access the individual
      pieces, and that code works the same regardless of whether the type
      is a struct or an array.  So, all that needs to be done is to check
      for compatible arrays and homogeneous structs.
      
      llvm-svn: 123381
      08713d3c
    • Bob Wilson's avatar
      Make SROA more aggressive with allocas containing padding. · 12eec40c
      Bob Wilson authored
      SROA only split up structs and arrays one level at a time, so padding can
      only cause trouble if it is located in between the struct or array elements.
      
      llvm-svn: 123380
      12eec40c
  4. Jan 12, 2011
  5. Jan 11, 2011
  6. Jan 10, 2011
Loading