https://bugs.llvm.org/show_bug.cgi?id=46974
Bug ID: 46974
Summary: Add specializations of small std::tuple to reduce
pre-optimization code generation
Product: libc++
Version: 11.0
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: All Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: dshar...@google.com
CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
I've noticed that if I replace std::make_tuple(a, b) with std::make_pair(a, b)
where I can, I get a few percent reduction in the size of -S -emit-llvm -O0,
and build time with -O2 appears to go down by 3-5%. I didn't change anything
else (kept using std::get<0>/std::get<1> to access these tuples).
The thing is, std::tuple(a, b) where I know there are exactly two elements is
only a very small fraction of the tuple usage in my project. There are still
many usages of std::tuple<T...> where sizeof...(T) is 2, but I don't know that
at compile time. My program makes heavy use of tuple_cat and make_tuple. The
vast majority of the tuple usage is for <= 5 tuple elements.
It seems like if there were a special case implementation of std::tuple<>,
std::tuple<T>, std::tuple<T1, T2>, ... up to some small finite number of types,
it could have a significant impact on the pre-optimization code size and build
time of tuple-using code.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs