[PATCH] D26581: Make WholeProgramDevirt understand ConstStruct vtables.
l via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 28 14:10:15 PST 2016
LemonBoy marked 3 inline comments as done.
LemonBoy added inline comments.
================
Comment at: lib/Transforms/IPO/WholeProgramDevirt.cpp:403
+
+ Op = SL->getElementContainingOffset(GlobalSlotOffset);
+ } else if (auto *C = dyn_cast<ConstantArray>(I)) {
----------------
pcc wrote:
> I think you also want to check that `SL->getElementOffset(Op) == GlobalSlotOffset`.
>
> Please add negative tests for that case and the out-of-bounds case you have above.
I haven't been able to come up with a way to access the table mid-element via a GEP but have added the check anyway.
https://reviews.llvm.org/D26581
More information about the llvm-commits
mailing list