[all-commits] [llvm/llvm-project] ecb502: [ObjC] Emit selector load right before msgSend call.
Ahmed Bougacha via All-commits
all-commits at lists.llvm.org
Wed Jan 26 20:53:10 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ecb502342cf2b3b4b6dfcd8fe881c596880d1a4a
https://github.com/llvm/llvm-project/commit/ecb502342cf2b3b4b6dfcd8fe881c596880d1a4a
Author: Ahmed Bougacha <ahmed at bougacha.org>
Date: 2022-01-26 (Wed, 26 Jan 2022)
Changed paths:
M clang/lib/CodeGen/CGObjCMac.cpp
M clang/test/CodeGenObjC/arc-foreach.m
M clang/test/CodeGenObjC/arc-literals.m
M clang/test/CodeGenObjC/arc-loadweakretained-release.m
M clang/test/CodeGenObjC/arc-precise-lifetime.m
M clang/test/CodeGenObjC/arc-property.m
M clang/test/CodeGenObjC/arc-related-result-type.m
M clang/test/CodeGenObjC/arc.m
M clang/test/CodeGenObjC/class-stubs.m
M clang/test/CodeGenObjC/matrix-type-operators.m
M clang/test/CodeGenObjC/ns_consume_null_check.m
M clang/test/CodeGenObjC/nsvalue-objc-boxable-ios-arc.m
M clang/test/CodeGenObjC/nsvalue-objc-boxable-ios.m
M clang/test/CodeGenObjC/nsvalue-objc-boxable-mac-arc.m
M clang/test/CodeGenObjC/nsvalue-objc-boxable-mac.m
M clang/test/CodeGenObjC/objc-container-subscripting-1.m
M clang/test/CodeGenObjC/property.m
M clang/test/CodeGenObjC/tentative-cfconstantstring.m
M clang/test/CodeGenObjCXX/arc-cxx11-member-init.mm
M clang/test/CodeGenObjCXX/arc.mm
M clang/test/CodeGenObjCXX/message.mm
M clang/test/CodeGenObjCXX/property-lvalue-capture.mm
M clang/test/CodeGenObjCXX/property-object-reference.mm
Log Message:
-----------
[ObjC] Emit selector load right before msgSend call.
We currently emit the selector load early, but only because we need
it to compute the signature (so that we know which msgSend variant to
call). We can prepare the signature with a plain undef, and replace
it with the materialized selector value if (and only if) needed, later.
Concretely, this usually doesn't have an effect, but tests need updating
because we reordered the receiver bitcast and the selector load, which
is always fine.
There is one notable change: with this, when a msgSend needs a
receiver null check, the selector is now loaded in the non-null
block, instead of before the null check. That should be a mild
improvement.
More information about the All-commits
mailing list