Maybe \return instead of \brief Return
A const & would probably be more appropriate.
CI is not valid anymore at this point.
Add a comment for the new arg
Why is the example removed here?
Add a comment explaining what this method does.
The part mentioning 64 bits is, I believe, not in sync with the code.
I wonder how much of this logic applies to other target. What I am saying is that this may be beneficial for AArch64, but is it true for X86 for instance?
This should only be in the else block, right?
Indeed, if canFormExtLd returns true, the changes are committed and there isn't anything else added to the transaction AFAICT. Thus this call does nothing.
What purpose does this serve?
For this condition, same question, how does this apply to something that is not AArch64?
Addressed Quentin's comments. Please take a look and let me know any comments.
No need to add CI in RemovedExtInsts because none of extension removed here is considered in optimizeExt().
Yes, I move this comment in AArch64TTIImpl::shouldConsiderAddressTypePromotion().
I believe this should target specific. So I move this into AArch64TTIImpl by adding another parameter (AllowPromotionWithoutCommonHeader) decided in shouldConsiderAddressTypePromotion().
In case case canFormExtLd returns false, we should check ATPConsiderable and if ATPConsiderable is false rollback should happen.
Yes, look like this is useless. I removed it. If canFormExtLd is true, return from this function (optimizeExt) instead.
This should be target specific. So this should be mentioned in AArch64TTIImpl .