[llvm-commits] [llvm] r161292 - /llvm/trunk/tools/llc/llc.cpp

Bob Wilson bob.wilson at apple.com
Tue Aug 7 17:32:31 PDT 2012


On Aug 3, 2012, at 9:49 PM, Bob Wilson <bob.wilson at apple.com> wrote:

> 
> On Aug 3, 2012, at 6:29 PM, NAKAMURA Takumi <geek4civic at gmail.com> wrote:
> 
>> Author: chapuni
>> Date: Fri Aug  3 20:29:37 2012
>> New Revision: 161292
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=161292&view=rev
>> Log:
>> llc: Try to suppress failures since r161262 .
>> 
>> FIXME: Fix several tests on i686-win32 due to lacking of many libraries.
> 
> I'm not sure I understand what's going on here.  It seems like perhaps llc was relying on the TargetLibraryInfo pass being created without a triple when run for i686-win32.  As far as I can tell, prior to my change, the TargetLibraryInfo pass was being created automatically by the pass manager using its default constructor with no triple.  When invoked from clang, however, the TargetLibraryInfo pass is constructed with the proper triple.  Something seems wrong there.
> 
> What tests were failing?

Nevermind.  I see that you already gave a list of failing tests in a separate message.

I figured out what is happening.  The tests in question do not specify a target triple either in the IR or with -mtriple on the command line.  The llc driver calculates a triple, starting with the system default, and then calling TargetRegistry::lookupTarget which typically replaces the triple's architecture based on a -march option.  The triple's OS field will remain set to the system default, win32 in your case.

I will change the failing tests to specify triples and then undo your workaround.

> 
>> Modified:
>>   llvm/trunk/tools/llc/llc.cpp
>> 
>> Modified: llvm/trunk/tools/llc/llc.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=161292&r1=161291&r2=161292&view=diff
>> ==============================================================================
>> --- llvm/trunk/tools/llc/llc.cpp (original)
>> +++ llvm/trunk/tools/llc/llc.cpp Fri Aug  3 20:29:37 2012
>> @@ -495,9 +495,12 @@
>> 
>>  // Add an appropriate TargetLibraryInfo pass for the module's triple.
>>  TargetLibraryInfo *TLI = new TargetLibraryInfo(TheTriple);
>> -  if (DisableSimplifyLibCalls)
>> +  if (DisableSimplifyLibCalls) {
>>    TLI->disableAllFunctions();
>> -  PM.add(TLI);
>> +
>> +    // FIXME: Fix several tests on i686-win32 due to lacking of many libraries.
>> +    PM.add(TLI);
>> +  }
>> 
>>  // Add the target data from the target machine, if it exists, or the module.
>>  if (const TargetData *TD = Target.getTargetData())
>> 
>> 
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 




More information about the llvm-commits mailing list