[llvm] [RISCV] Remove`riscv.segN.load/store` in favor of their mask variants (PR #137045)
Harald van Dijk via llvm-commits
llvm-commits at lists.llvm.org
Mon May 12 04:39:36 PDT 2025
hvdijk wrote:
> Note that riscv.segN.load/store.mask does not take pointer type (i.e. address space) as part of its overloading type signature, because RISC-V doesn't really use address spaces other than the default one.
When user code does use address spaces expecting the backend to ignore them, the fact that the masked intrinsics don't take pointer type now causes LLVM to assert when these are used unchecked (``/home/harald/llvm-project/main/llvm/lib/IR/Instructions.cpp:754: void llvm::CallInst::init(llvm::FunctionType*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, llvm::ArrayRef<llvm::OperandBundleDefT<llvm::Value*> >, const llvm::Twine&): Assertion `(i >= FTy->getNumParams() || FTy->getParamType(i) == Args[i]->getType()) && "Calling a function with a bad signature!"' failed.``). We cannot just assume that LLVM IR does not use address spaces, even if the backend does not care about them.
Back when I had submitted https://github.com/llvm/llvm-project/pull/91573 for a similar issue elsewhere, it had been said that we should update the intrinsics to take pointer type. Should we include a similar check here to skip non-default address spaces so that we don't crash, or should we take this as a good opportunity to add proper support for non-default address spaces?
https://github.com/llvm/llvm-project/pull/137045
More information about the llvm-commits
mailing list