[PATCH] D42528: [LTO] - Introduce GlobalResolution::Prevailing flag.
George Rimar via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 07:30:03 PST 2018
Sorry, I thought I am responding to D42107 thread :)
In this thread you right. I'll update the patch in a minute.
Best regards,
George | Developer | Access Softek, Inc
________________________________________
От: George Rimar
Отправлено: 25 января 2018 г. 18:20
Кому: Rafael Avila de Espindola; reviews+D42528+public+221bfc9b60e2bf03 at reviews.llvm.org; tejohnson at google.com
Копия: joker.eph at gmail.com; llvm at inglorion.net; Igor Kudrin; Evgeny Leviant; llvm-commits at lists.llvm.org
Тема: Re: [PATCH] D42528: [LTO] - Introduce GlobalResolution::Prevailing flag.
>> Index: lib/LTO/LTO.cpp
>> ===================================================================
>> --- lib/LTO/LTO.cpp
>> +++ lib/LTO/LTO.cpp
>> @@ -419,11 +419,14 @@
>> auto &GlobalRes = GlobalResolutions[Sym.getName()];
>> GlobalRes.UnnamedAddr &= Sym.isUnnamedAddr();
>> if (Res.Prevailing) {
>> - assert(GlobalRes.IRName.empty() &&
>> + assert(!GlobalRes.Prevailing &&
>> "Multiple prevailing defs are not allowed");
>> - GlobalRes.IRName = Sym.getIRName();
>> + GlobalRes.Prevailing = true;
>> }
>>
>> + if (GlobalRes.IRName.empty())
>> + GlobalRes.IRName = Sym.getIRName();
>
>Why do you need the second if? It is still true that only for prevailing
>symbols we need the name, no?
No. Previously GlobalRes.IRName was set only for prevailing symbols.
And so "if (GlobalRes.IRName)" was used like "if (Prevailing)".
But now I need IRName for both privailing and not-prevailing symbols
(see change in Error LTO::run(AddStreamFn AddStream, NativeObjectCache Cache) ).
So I had to add bool Prevailing flag.
With that I can mark Live all PrevailingType::Yes and PrevailingType::Unknown
and make PrevailingType::No dead.
>That is, could this be:
>
> if (Res.Prevailing) {
> assert(!GlobalRes.Prevailing &&
> "Multiple prevailing defs are not allowed");
> GlobalRes.IRName = Sym.getIRName();
> GlobalRes.Prevailing = true;
> GlobalRes.IRName = Sym.getIRName();
> }
>
>Cheers,
>Rafael
George.
More information about the llvm-commits
mailing list