diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2016-12-11 09:50:05 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2016-12-11 09:50:05 +0000 |
commit | 20247900d7867ceb91f97ce6c4b7a42b1d224c18 (patch) | |
tree | 4f382850c8896e6bf3382147cc1148b553349b7b /llvm/test/CodeGen/X86/umul-with-overflow.ll | |
parent | 23ebd9564f34600d186e53ee3497319c28e73cde (diff) | |
download | bcm5719-llvm-20247900d7867ceb91f97ce6c4b7a42b1d224c18.tar.gz bcm5719-llvm-20247900d7867ceb91f97ce6c4b7a42b1d224c18.zip |
Refactor FileCheck some to reduce memory allocation and copying. Also
make some readability improvements.
Both the check file and input file have to be fully buffered to
normalize their whitespace. But previously this would be done in a stack
SmallString and then copied into a heap allocated MemoryBuffer. That
seems pretty wasteful, especially for something like FileCheck where
there are only ever two such entities.
This just rearranges the code so that we can keep the canonicalized
buffers on the stack of the main function, use reasonably large stack
buffers to reduce allocation. A rough estimate seems to show that about
80% of LLVM's .ll and .s files will fit into a 4k buffer, so this should
completely avoid heap allocation for the buffer in those cases. My
system's malloc is fast enough that the allocations don't directly show
up in timings. However, on some very slow test cases, this saves 1% - 2%
by avoiding the copy into the heap allocated buffer.
This also splits out the code which checks the input into a helper much
like the code to build the checks as that made the code much more
readable to me. Nit picks and suggestions welcome here. It has really
exposed a *bunch* of stuff that could be cleaned up though, so I'm
probably going to go and spring clean all of this code as I have more
changes coming to speed things up.
llvm-svn: 289378
Diffstat (limited to 'llvm/test/CodeGen/X86/umul-with-overflow.ll')
0 files changed, 0 insertions, 0 deletions