[prev in list] [next in list] [prev in thread] [next in thread] 

List:       llvm-commits
Subject:    Re: [PATCH] D11606: Vtable aliasing improvement: makes obj->vtable noalias obj and modref(obj->virt_
From:       Richard Smith <richard () metafoo ! co ! uk>
Date:       2015-08-05 21:05:53
Message-ID: ce1d15a5ac9f642593a640c64f7d55b2 () localhost ! localdomain
[Download RAW message or body]

rsmith added a subscriber: rsmith.
rsmith requested changes to this revision.
rsmith added a reviewer: rsmith.
rsmith added a comment.
This revision now requires changes to proceed.

Your assumption that the vptr for an object cannot change during a virtual call to \
that object is not correct; the rules here are more subtle. See the recent "Clang \
devirtualization proposal" thread on llvm-dev / cfe-dev for an approach that handles \
the cases where the vptr actually cannot change; Piotr Padlewski is currently working \
on implementing that approach.


================
Comment at: lib/Analysis/BasicAliasAnalysis.cpp:1462-1464
@@ -1436,1 +1461,5 @@
+
+    // Considering Object's Vtable can't alias Object
+    if (isVtableLoadFrom(O1, O2) || isVtableLoadFrom(O2, O1))
+      return NoAlias;
   }
----------------
This is redundant in many cases (we can already deduce this if the load from the \
object has TBAA metadata, or if we can see the pointers are distinct), and wrong in \
other cases (for instance, using memcpy to write over the storage for an object that \
had a vptr).


http://reviews.llvm.org/D11606



_______________________________________________
llvm-commits mailing list
llvm-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic