Don't expose OpTy way earlier than needed and we don't have the problem of having to assign nullptr if we are looking at the wrong type of instruction.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM!
This seem to help out avoiding complaints from clangsa that the OpTy passed on to getCastInstrCost could be a nullptr (implementations of getCastInstrCost doesn't seem to check that the Src/Dst Type pointers are non-null. One could perhaps question the API (if those pointers must not be null then I guess one could have passed the Type arguments by reference instead of passing the pointer). This patch in itself seem good anyway.