New LLVM pass

I want to write a llvm pass which replaces f32 with i32.How to access the type of instructions in .cpp file in order achieve this.

Thank you

I don’t know the exact process. But there is a tutorial on LLVM which describes how to write out of tree analysis and transformations passes with both new and old legacy pass manager. That should be useful.
Link- https://github.com/banach-space/llvm-tutor#overview-of-the-passes

@aruna, just to clarify, do you want to make this modifications at the IR level? In other words, you’re not interested in modifying the input *.cpp or *.c file? Just making sure this is not a Clang question :slight_smile:

For LLVM, take a look here: https://llvm.org/docs/LangRef.html#llvm-fptoui-sat-intrinsic.