diff options
author | Piotr Padlewski <piotr.padlewski@gmail.com> | 2017-01-12 11:33:58 +0000 |
---|---|---|
committer | Piotr Padlewski <piotr.padlewski@gmail.com> | 2017-01-12 11:33:58 +0000 |
commit | 9530883e8c4714b98e2c7141cfa20699dd0f40cb (patch) | |
tree | b85cdddd6f6e1ac9354002a07843bd4276d3a4e4 /clang/lib/Lex/ModuleMap.cpp | |
parent | fef77a430a0e8ea17783dde91f79332a52d9803e (diff) | |
download | llvm-9530883e8c4714b98e2c7141cfa20699dd0f40cb.zip llvm-9530883e8c4714b98e2c7141cfa20699dd0f40cb.tar.gz llvm-9530883e8c4714b98e2c7141cfa20699dd0f40cb.tar.bz2 |
[Devirtualization] MemDep returns non-local !invariant.group dependencies
Summary:
Memory Dependence Analysis was limited to return only local dependencies
for invariant.group handling. Now it returns NonLocal when it finds it
and then by asking getNonLocalPointerDependency we get found dep.
Thanks to this we are able to devirtualize loops!
void indirect(A &a, int n) {
for (int i = 0 ; i < n; i++)
a.foo();
}
void test(int n) {
A a;
indirect(a);
}
After inlining a.foo() will be changed to direct call, even if foo and A::A()
is external (but only if vtable definition is be available).
Reviewers: nlewycky, dberlin, chandlerc, rsmith
Subscribers: mehdi_amini, davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D28137
llvm-svn: 291762
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
0 files changed, 0 insertions, 0 deletions