[llvm] [NFC] Convert LoadExtActions to a map (PR #157627)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 9 10:06:28 PDT 2025
QuantumSegfault wrote:
Behavior right now is exactly the same as before, so it works in that respect.
Maybe I'm still missing something, but I don't see how having a default parameter helps us.
Once a Custom handler is set for address space 1, the existing code will still see that the default one (0) is still "Legal", and make incorrect assumptions. So then all the (indirect) uses of getLoadExtAction (including uses isLoadExtLegal[OrCustom] of) need to be made address space aware. And then to make sure that those changes work correctly, any backends using extloads from anything other than address space 0 need fixing (not many, I imagine).
Some places are easy to get an address space for, but what about something like `BasicTTIIImpl::getCastInstrCost`?
```cpp
InstructionCost
getCastInstrCost(unsigned Opcode, Type *Dst, Type *Src,
TTI::CastContextHint CCH, TTI::TargetCostKind CostKind,
const Instruction *I = nullptr) const override {
```
https://github.com/llvm/llvm-project/blob/3ce16565c81df86b556cd25dc40c7a03000169dd/llvm/include/llvm/CodeGen/BasicTTIImpl.h#L1240-L1251
https://github.com/llvm/llvm-project/pull/157627
More information about the llvm-commits
mailing list