[PATCH] D12535: [PR24643] Speeding up FoldingSetNodeID::AddPointer

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 08:24:27 PDT 2015


bkramer added a comment.

This is very strange. What compiler are you using to compile LLVM?

In trunk, SmallVector<unsigned>::append will always use memcpy, never memmove. It also has a constant size so the copy should be lowered into a single movq on x86_64. I verified this with clang -O3 and gcc 5.1 -O3, both generate optimal code for append and messy code for AddInteger.

What's possible is that all your pointers fit into 32 bits so the overall footprint of the FoldingSetNodeID is reduced (AddInteger truncates to 32 bits if the integer fits). Can you confirm that?


http://reviews.llvm.org/D12535





More information about the llvm-commits mailing list