Return the best covering index, and additional needed to complete the
mask. This logically belongs in TargetRegisterInfo, although I ended
up not needing it for why I originally split this out.
Details
Diff Detail
Event Timeline
Seems like an obvious refactoring to me. I think the API could be simplified though. How about returning all indices via the SmallVector, and returning a bool failure indication? Or say that if the vector is empty, it means failure?
llvm/include/llvm/CodeGen/TargetRegisterInfo.h | ||
---|---|---|
361–362 | Maybe "the additional ones will be returned in" would be clearer? |
I was conflicted about this, but thought returning the single "best" one was useful information
I think the weirder part of the current API is the "best" one isn't included in the complete vector
llvm/include/llvm/CodeGen/TargetRegisterInfo.h | ||
---|---|---|
366 | The API looks fine but I think the comment could be clearer. E.g., what is the best matching index when we need more than one indexes? Maybe we could return a bool: a covering exists or not, and just always fill Indexes? |
Maybe "the additional ones will be returned in" would be clearer?