This patch is *NOT* ready to commite yet, it's PoC of the pragma approache to
reduce the size of riscv_vector.h and speed up the including effort.
Syntax for the new pragma:
#pragma riscv intrinsic <extension name>
And we only support for vector now:
#pragma riscv intrinsic vector
Size of riscv_vector.h:
| size | LoC | ------------------------------ Before | 4,434,725 | 69,749 | After | 5,463 | 159 |
testcase:
#include <riscv_vector.h> vint32m1_t test_vadd_vv_vfloat32m1_t(vint32m1_t op1, vint32m1_t op2, size_t vl) { return vadd(op1, op2, vl); }
Release build:
Before: 0m0.417s After: 0m0.090s
Debug build:
Before: 0m8.016s After: 0m2.295s
- Measure by time command.
LLVM regression on our 48 core server:
Release build:
Before : Testing Time: 203.81s
After : Testing Time: 181.13s
Debug build:
Before : Testing Time: 675.18s
After : Testing Time: 647.20s
Can we capture Sema in the lambda capture list here so that it's not really passed to initializeTargetOverloadBuiltins. I don't think forward declaring Sema in Builtins.h is a good idea since the "Basic" library isn't supposed to know about Sema. That probably means you need to use a std::function instead of a function pointer.