Implement LLVM IR Witness Method Elimination for Swift witness tables. (#39287)

- Witness method calls are done via @llvm.type.checked.load instrinsic call with a type identifier
- Type id of a witness method is the requirement's mangled name
- Witness tables get !type markers that list offsets and type ids of all methods in the wtable
- Added -enable-llvm-wme to enable Witness Method Elimination
- Added IR test and execution test
This commit is contained in:
Kuba (Brecka) Mracek
2021-09-21 06:57:44 -07:00
committed by GitHub
parent 29bc118f5b
commit 46eb8d5db5
10 changed files with 190 additions and 19 deletions

View File

@@ -1908,6 +1908,10 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
Opts.VirtualFunctionElimination = true;
}
if (Args.hasArg(OPT_enable_llvm_wme)) {
Opts.WitnessMethodElimination = true;
}
// Default to disabling swift async extended frame info on anything but
// darwin. Other platforms are unlikely to have support for extended frame
// pointer information.