Skip to content
Commit 5f25bc30 authored by Saleem Abdulrasool's avatar Saleem Abdulrasool
Browse files

[CodeGen] tighten objc ivar invariant.load attribution



An ivar ofset cannot be marked as invariant load in all cases.  The ivar offset
is a lazily initialised constant, which is dependent on an objc_msgSend
invocation to perform a fixup of the offset.  If the load is being performed on
a method implemented by the class then this load can safely be marked as an
inviarant because a message must have been passed to the class at some point,
forcing the ivar offset to be resolved.

An additional heuristic that can be used to identify an invariant load would be
if the ivar offset base is a parameter to an objc method.  However, without the
parameters available at hand, this is currently not possible.

Reviewed-by: default avatarJohn McCall <rjmccall@apple.com>
Signed-off-by: default avatarSaleem Abdulrasool <compnerd@compnerd.org>
llvm-svn: 175386
parent 1286ef9c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment