Currently, as per check-llvm, we never call SCEVExpander::isHighCostExpansion() with null TTI,
so this appears to be a safe restriction.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I'm not sure about how we should interpret lack of TTI. Maybe we should interpret it like "if there is no model, we don't care about the high costs, and everything is low cost enough", or opposite (like in your patch). Neither of this looks NFC to me (given that we can pass null TTI). Maybe we should merge it *after* we make use of TTI inside the methods?
Ack, this is non-obvious.
Neither of this looks NFC to me (given that we can pass null TTI).
Alternatively, we can simply require TTI - i believe at least in all the current callsites, it *will* be provided.
Maybe we should merge it *after* we make use of TTI inside the methods?
We have to account for the null possibility somehow, if we don't we would just be adding potential null pointer dereference.