aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-07 08:11:13 +0000
committerChris Lattner <sabre@nondot.org>2009-01-07 08:11:13 +0000
commitf2b8c82ad1c398bc5d91df0c5435c410b2a3f034 (patch)
tree228857a781e984ab710c2e3d62fd3b33d3818aef /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent9a2de65fd638f96632373d56dd98f566a577e943 (diff)
downloadllvm-f2b8c82ad1c398bc5d91df0c5435c410b2a3f034.zip
llvm-f2b8c82ad1c398bc5d91df0c5435c410b2a3f034.tar.gz
llvm-f2b8c82ad1c398bc5d91df0c5435c410b2a3f034.tar.bz2
Implement the first half of PR3290: if there is a store of an
integer to a (transitive) bitcast the alloca and if that integer has the full size of the alloca, then it clobbers the whole thing. Handle this by extracting pieces out of the stored integer and filing them away in the SROA'd elements. This triggers fairly frequently because the CFE uses integers to pass small structs by value and the inliner exposes these. For example, in kimwitu++, I see a bunch of these with i64 stores to "%struct.std::pair<std::_Rb_tree_const_iterator<kc::impl_abstract_phylum*>,bool>" In 176.gcc I see a few i32 stores to "%struct..0anon". In the testcase, this is a difference between compiling test1 to: _test1: subl $12, %esp movl 20(%esp), %eax movl %eax, 4(%esp) movl 16(%esp), %eax movl %eax, (%esp) movl (%esp), %eax addl 4(%esp), %eax addl $12, %esp ret vs: _test1: movl 8(%esp), %eax addl 4(%esp), %eax ret The second half of this will be to handle loads of the same form. llvm-svn: 61853
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
0 files changed, 0 insertions, 0 deletions