diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-09 01:11:15 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-03-09 01:11:15 +0000 |
commit | 0152c8156be6aa8c3e85903625fa3e76206dca8b (patch) | |
tree | 1af091564511a6f63b8dcb428cc55c930d5df9d7 /llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | |
parent | 3f57cff1e821d742c71e46dae67aadd65e2f1be2 (diff) | |
download | bcm5719-llvm-0152c8156be6aa8c3e85903625fa3e76206dca8b.tar.gz bcm5719-llvm-0152c8156be6aa8c3e85903625fa3e76206dca8b.zip |
WholeProgramDevirt: Implement importing for uniform ret val opt.
Differential Revision: https://reviews.llvm.org/D29854
llvm-svn: 297350
Diffstat (limited to 'llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp')
-rw-r--r-- | llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp index f321a8c8eb7..51d30f3c244 100644 --- a/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp +++ b/llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp @@ -1126,6 +1126,24 @@ void DevirtModule::importResolution(VTableSlot Slot, VTableSlotInfo &SlotInfo) { applySingleImplDevirt(SlotInfo, SingleImpl, IsExported); assert(!IsExported); } + + for (auto &CSByConstantArg : SlotInfo.ConstCSInfo) { + auto I = Res.ResByArg.find(CSByConstantArg.first); + if (I == Res.ResByArg.end()) + continue; + auto &ResByArg = I->second; + // FIXME: We should figure out what to do about the "function name" argument + // to the apply* functions, as the function names are unavailable during the + // importing phase. For now we just pass the empty string. This does not + // impact correctness because the function names are just used for remarks. + switch (ResByArg.TheKind) { + case WholeProgramDevirtResolution::ByArg::UniformRetVal: + applyUniformRetValOpt(CSByConstantArg.second, "", ResByArg.Info); + break; + default: + break; + } + } } void DevirtModule::removeRedundantTypeTests() { |