Printing the analysis result of lazy value info

Hello all,

How can I see the result of lazy value info analysis?

I ran a command opt -lazy-value-info -correlated-propagation -print-lazy-value-info example.ll -disable-output with a following program as the input:


define i32 @f(i32 %a, i32 %b) {
%i = icmp eq i32 %a, 10
br i1 %i, label %A, label %B
A:
%c = add i32 %a, 20
ret i32 %c
B:
ret i32 0
}

However, it shows a following line only:

LVI for function 'f':

Thank you :slight_smile:
Juneyoung Lee

Juneyoung, I don't know if this meets your requirements but I have a silly little pass that I use to see what the LVI, SCEV, demanded bits, and known bits analyses think about a module:

https://github.com/regehr/llvm-transformation-pass/blob/master/hello/hello.cpp

John

I’d have expected the command you ran to work. I’m guessing there’s some bug that’s crept in.

If you want to spend some time tracking it down, I’d be happy to review a patch.

Philip

Hello all, I just read mails.

https://github.com/regehr/llvm-transformation-pass/blob/master/hello/hello.cpp
Thank you for the program, I’ll try it.

If you want to spend some time tracking it down, I’d be happy to review a patch.
Yep, I’ll track it down and make a patch.

Juneyoung Lee

This was because CVP didn’t preserve LVI.

I made a patch that deals with this - https://reviews.llvm.org/D59349

Juneyoung Lee