[llvm] r299908 - [bugpoint] Also remove comdat's from externalized GVs

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 10 18:36:01 PDT 2017


On 04/10/2017 07:34 PM, Davide Italiano wrote:
> On Mon, Apr 10, 2017 at 5:18 PM, Hal Finkel via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: hfinkel
>> Date: Mon Apr 10 19:18:42 2017
>> New Revision: 299908
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=299908&view=rev
>> Log:
>> [bugpoint] Also remove comdat's from externalized GVs
>>
>> We were removing comdats from externalized functions (function declarations
>> can't be comdat), but were not doing the same for variable. Failure to do this
>> would cause bugpoint to fail ("Declaration may not be in a Comdat!").
>>
>> Modified:
>>      llvm/trunk/tools/bugpoint/ExtractFunction.cpp
>>
>> Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=299908&r1=299907&r2=299908&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
>> +++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Mon Apr 10 19:18:42 2017
>> @@ -209,6 +209,7 @@ static void eliminateAliases(GlobalValue
>>   void llvm::DeleteGlobalInitializer(GlobalVariable *GV) {
>>     eliminateAliases(GV);
>>     GV->setInitializer(nullptr);
>> +  GV->setComdat(nullptr);
>>   }
>>
> Do you have a testcase where this fails? If so, can you please add it?

I came to this when trying to run bugpoint on a tramp3d-v4 miscompile. 
To write a test case with the current setup I'd need to trigger the same 
codepath in a crash which can do the right thing with one of our crasher 
plugins. That might be possible, but I'll need to play with it a bit.

  -Hal

>
> Thanks!
>

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-commits mailing list