Skip to content
  • Chris Lattner's avatar
    change iterator invalidation avoidance to just move the iterator backward · 4311ad2d
    Chris Lattner authored
    when something changes, instead of moving forward.  This allows us to 
    simplify memset lowering, inserting the memset at the end of the range of 
    stuff we're touching instead of at the start.
    
    This, in turn, allows us to make use of the addressing instructions already
    used in the function instead of inserting our own.  For example, we now
    codegen:
    
    	%tmp41 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 0		; <i8*> [#uses=2]
    	call void @llvm.memset.i64( i8* %tmp41, i8 -1, i64 8, i32 1 )
    
    instead of:
    
    	%tmp20 = getelementptr [8 x i8]* %ref_idx, i32 0, i32 7		; <i8*> [#uses=1]
    	%ptroffset = getelementptr i8* %tmp20, i64 -7		; <i8*> [#uses=1]
    	call void @llvm.memset.i64( i8* %ptroffset, i8 -1, i64 8, i32 1 )
    
    llvm-svn: 48940
    4311ad2d
Loading