<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 2, 2016 at 4:33 AM Ahmed Bougacha <<a href="mailto:ahmed.bougacha@gmail.com">ahmed.bougacha@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Aug 1, 2016 at 11:30 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
> Any particular reason/motivation for this?<br>
<br>
Not really, seemed like free goodness that can only help (I measured<br>
after the fact, looks like it shaves off a few dozen indirect calls in<br>
AArch64 passes; don't know how frequent they are though).<br>
<br>
Now I'm curious: it's not?<br></blockquote><div><br></div><div>Not free? Nah, it's pretty free - we just haven't been in the habit of marking classes final as a matter of course. If you observed some benefit (even just statically) & these classes aren't generally intended to be derived from, seems fine to me. Good to have the motivation here in this commit list (maybe good to have it in a comment too) so if someone does decide to derive from it and remove 'final' they aren't worried about extra gotchas lurking in the API (eg: they don't have to worry that the type has some fundamental problem with being derived from that may cause issues)<br><br>I didn't know we did devirtualize based on 'final' - it's obvious/good, and good to know we do.<br><br>- Dave</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
-Ahmed<br>
<br>
> On Wed, Jul 27, 2016 at 7:39 AM Ahmed Bougacha via llvm-commits<br>
> <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
>><br>
>> Author: ab<br>
>> Date: Wed Jul 27 09:31:46 2016<br>
>> New Revision: 276874<br>
>><br>
>> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=276874&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=276874&view=rev</a><br>
>> Log:<br>
>> [AArch64] Mark various *Info classes as 'final'. NFC.<br>
>><br>
>> Modified:<br>
>>     llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h<br>
>>     llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h<br>
>>     llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h<br>
>>     llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h<br>
>>     llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h<br>
>><br>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h?rev=276874&r1=276873&r2=276874&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h?rev=276874&r1=276873&r2=276874&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h (original)<br>
>> +++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.h Wed Jul 27 09:31:46<br>
>> 2016<br>
>> @@ -27,7 +27,7 @@ namespace llvm {<br>
>>  class AArch64Subtarget;<br>
>>  class AArch64TargetMachine;<br>
>><br>
>> -class AArch64InstrInfo : public AArch64GenInstrInfo {<br>
>> +class AArch64InstrInfo final : public AArch64GenInstrInfo {<br>
>>    const AArch64RegisterInfo RI;<br>
>>    const AArch64Subtarget &Subtarget;<br>
>><br>
>><br>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h?rev=276874&r1=276873&r2=276874&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h?rev=276874&r1=276873&r2=276874&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h (original)<br>
>> +++ llvm/trunk/lib/Target/AArch64/AArch64MachineFunctionInfo.h Wed Jul 27<br>
>> 09:31:46 2016<br>
>> @@ -23,7 +23,7 @@ namespace llvm {<br>
>><br>
>>  /// AArch64FunctionInfo - This class is derived from MachineFunctionInfo<br>
>> and<br>
>>  /// contains private AArch64-specific information for each<br>
>> MachineFunction.<br>
>> -class AArch64FunctionInfo : public MachineFunctionInfo {<br>
>> +class AArch64FunctionInfo final : public MachineFunctionInfo {<br>
>><br>
>>    /// Number of bytes of arguments this function has on the stack. If the<br>
>> callee<br>
>>    /// is expected to restore the argument stack this should be a multiple<br>
>> of 16,<br>
>><br>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h?rev=276874&r1=276873&r2=276874&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h?rev=276874&r1=276873&r2=276874&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h (original)<br>
>> +++ llvm/trunk/lib/Target/AArch64/AArch64RegisterBankInfo.h Wed Jul 27<br>
>> 09:31:46 2016<br>
>> @@ -30,7 +30,7 @@ enum {<br>
>>  } // End AArch64 namespace.<br>
>><br>
>>  /// This class provides the information for the target register banks.<br>
>> -class AArch64RegisterBankInfo : public RegisterBankInfo {<br>
>> +class AArch64RegisterBankInfo final : public RegisterBankInfo {<br>
>>    /// See RegisterBankInfo::applyMapping.<br>
>>    void applyMappingImpl(const OperandsMapper &OpdMapper) const override;<br>
>><br>
>><br>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h?rev=276874&r1=276873&r2=276874&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h?rev=276874&r1=276873&r2=276874&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h (original)<br>
>> +++ llvm/trunk/lib/Target/AArch64/AArch64RegisterInfo.h Wed Jul 27<br>
>> 09:31:46 2016<br>
>> @@ -24,7 +24,7 @@ class RegScavenger;<br>
>>  class TargetRegisterClass;<br>
>>  class Triple;<br>
>><br>
>> -class AArch64RegisterInfo : public AArch64GenRegisterInfo {<br>
>> +class AArch64RegisterInfo final : public AArch64GenRegisterInfo {<br>
>>    const Triple &TT;<br>
>><br>
>>  public:<br>
>><br>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h<br>
>> URL:<br>
>> <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h?rev=276874&r1=276873&r2=276874&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h?rev=276874&r1=276873&r2=276874&view=diff</a><br>
>><br>
>> ==============================================================================<br>
>> --- llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h (original)<br>
>> +++ llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h Wed Jul 27 09:31:46<br>
>> 2016<br>
>> @@ -32,7 +32,7 @@ class GlobalValue;<br>
>>  class StringRef;<br>
>>  class Triple;<br>
>><br>
>> -class AArch64Subtarget : public AArch64GenSubtargetInfo {<br>
>> +class AArch64Subtarget final : public AArch64GenSubtargetInfo {<br>
>>  public:<br>
>>    enum ARMProcFamilyEnum : uint8_t {<br>
>>      Others,<br>
>><br>
>><br>
>> _______________________________________________<br>
>> llvm-commits mailing list<br>
>> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>