How to use 'opt' command?

Hi all,

How to print the analysis results using ‘opt’ command?

I tried using the below command for my module.ll file

opt -analyze -memdep module.ll

But it’s printing

Printing analysis ‘Memory Dependence Analysis’ for function ‘main’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!
Printing analysis ‘Memory Dependence Analysis’ for function ‘CustomMalloc’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!
Printing analysis ‘Memory Dependence Analysis’ for function ‘wrapDouble’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!
Printing analysis ‘Memory Dependence Analysis’ for function ‘wrapString’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!
Printing analysis ‘Memory Dependence Analysis’ for function ‘isDoubleType’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!
Printing analysis ‘Memory Dependence Analysis’ for function ‘unwrapValue’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!
Printing analysis ‘Memory Dependence Analysis’ for function ‘ADD’:
Pass::print not implemented for pass: ‘Memory Dependence Analysis’!

Hi Sarah,
I believe opt takes the bytecode file (.bc) not the human readable form, but
i am just a learner...

Sam.

sarath chandra-5 wrote:

I believe opt takes the bytecode file (.bc) not the human readable form, but
i am just a learner...

  `opt` can eat *.ll file. You can give it a try. :slight_smile:

Regards,
chenwj

I believe opt takes the bytecode file (.bc) not the human readable form, but
i am just a learner...

It takes both.

Ciao, Duncan.

Hi Sarath,

How to print the analysis results using 'opt' command?

I tried using the below command for my *module.ll* file

*opt -analyze -memdep module.ll *
*
But it's printing

Printing analysis 'Memory Dependence Analysis' for function 'main':
Pass::print not implemented for pass: 'Memory Dependence Analysis'!

I guess it's not implemented for this analysis! That makes sense because
memdep is a lazy analysis, i.e. it only does something when a user of it
asks for some specific information. As it doesn't do any analysis
spontaneously, there is no analysis result for it to print in your context.

Ciao, Duncan.