[llvm-dev] Dump LLVM StoreInst

Davide Italiano via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 9 17:47:24 PST 2018


On Fri, Mar 9, 2018 at 9:18 AM, Zhou Zhizhong via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Hi,
>
> I’m writing a loop-free LLVM pass, my thought is to track if the value inside the loop is changed, so I look up the Instruction StoreInst first and try to get its value in a set. I checked getValueOperand(), getValueName() in the API document but unfortunately they failed the compilation.
>

If you want to check for loop invariance, LICM has logic for doing
what you want. To track the evolution of a variable inside a loop,
there's already an
analysis, ScalarEvolution. In general, I'd recommend to check how loop
passes in LLVM perform this kind of analysis before writing your own.

-- 
Davide

"There are no solved problems; there are only problems that are more
or less solved" -- Henri Poincare


More information about the llvm-dev mailing list