https://github.com/nikic requested changes to this pull request. There shouldn't be an IRBuilderFolder API that is specific to this intrinsic. This is a specific instance of general intrinsic folding support. https://github.com/llvm/llvm-project/pull/116229