rewrite the memset_pattern pattern generation stuff to accept any 2/4/8/16-byte
authorChris Lattner <sabre@nondot.org>
Sat, 19 Feb 2011 19:56:44 +0000 (19:56 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 19 Feb 2011 19:56:44 +0000 (19:56 +0000)
commit80e8b506b8134d63dc3cb6211cccc34be4b19d40
tree21ebd657abbe2afd75135ee6ce91e24e7e2e55a1
parent41bfbb0a8776674c486682cbf2aa80f15abfef68
rewrite the memset_pattern pattern generation stuff to accept any 2/4/8/16-byte
constant, including globals.  This makes us generate much more "pretty" pattern
globals as well because it doesn't break it down to an array of bytes all the
time.

This enables us to handle stores of relocatable globals.  This kicks in about
48 times in 254.gap, giving us stuff like this:

@.memset_pattern40 = internal constant [2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*] [%struct.TypHeader* (%struct.TypHeader*, %struct
.TypHeader*)* @IsFalse, %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)* @IsFalse], align 16

...
  call void @memset_pattern16(i8* %scevgep5859, i8* bitcast ([2 x %struct.TypHeader* (%struct.TypHeader*, %struct.TypHeader*)*]* @.memset_pattern40 to i8*
), i64 %tmp75) nounwind

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126044 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LoopIdiomRecognize.cpp
test/Transforms/LoopIdiom/basic.ll