I’m developing an LLVM pass to quantize a function by changing its return type from float to int32. Specifically, I have a function called mulfix with the following definition:
define dso_local float @mulfix(i32 %0, i32 %1)
I want to change it to:
define dso_local i32 @mulfix(i32 %0, i32 %1)
I encountered issues with directly erasing the old function. When I use eraseFromParent, it sometimes causes segmentation faults or other bugs. Is there a more robust way to handle this transition without directly erasing the old function?
Any help or pointers would be greatly appreciated. Thank you