[llvm-commits] [llvm] r76982 - in /llvm/trunk: include/llvm/Transforms/IPO/InlinerPass.h lib/Transforms/IPO/Inliner.cpp lib/Transforms/Scalar/DeadStoreElimination.cpp lib/Transforms/Scalar/JumpThreading.cpp lib/Transforms/Scalar/SimplifyHalfPowrL

Török Edwin edwintorok at gmail.com
Fri Jul 24 11:48:54 PDT 2009


On 2009-07-24 21:41, Eli Friedman wrote:
> On Fri, Jul 24, 2009 at 11:28 AM, Duncan Sands<baldrick at free.fr> wrote:
>   
>> Hi Dan,
>>
>>     
>>> Convert several more passes to use getAnalysisIfAvailable<TargetData>()
>>> instead of getAnalysis<TargetData>().
>>>
>>> Modified:
>>>     llvm/trunk/include/llvm/Transforms/IPO/InlinerPass.h
>>>     llvm/trunk/lib/Transforms/IPO/Inliner.cpp
>>>     llvm/trunk/lib/Transforms/Scalar/DeadStoreElimination.cpp
>>>     llvm/trunk/lib/Transforms/Scalar/JumpThreading.cpp
>>>     llvm/trunk/lib/Transforms/Scalar/SimplifyHalfPowrLibCalls.cpp
>>>       
>> suppose I have some bitcode that contains target data in it.
>> If I run "opt -inline" on it, will the target information be
>> used?  Since the inliner no longer requires target data, maybe
>>     

The tool has to create TargetData, because the passManager can't call
TargetData's constructor (it takes a param).
In fact if you require TargetData, and it wasn't added by the tool (opt)
then it'll assert out.

>> the TargetData pass won't be run at all, causing
>>   getAnalysisIfAvailable<TargetData>() to return NULL, and
>> target data not to be used even though present in the bitcode.
>>     
>
> AFAIK, opt will unconditionally add TargetData, whether or not a
> target is specified in the bitcode file.
>   

Once all passes use getAnalysisIfAvailable, I think opt should be
changed to add a TargetData
only when the bitcode has one, and not add a bogus targetdata like it
does currently.
Isn't that why these changes are made?


Best regards,
--Edwin



More information about the llvm-commits mailing list