Add a method for the various cases where we need to concatenate 2 KnownBits together (BUILD_PAIR and SHIFT_PARTS in particular) - uses the existing APInt::concat 'HiBits.concat(LoBits)' convention
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems reasonable. The API is a bit different from APInt::concat, but I never particularly liked that API anyway :)
llvm/include/llvm/Support/KnownBits.h | ||
---|---|---|
316 | Maybe just return { Hi.Zero.concat(Lo.Zero), Hi.One.concat(Lo.One) }? |
llvm/include/llvm/Support/KnownBits.h | ||
---|---|---|
316 | Hmm - I'd forgotten about APInt::concat - I guess we should try to make a similar KnownBits::concat ? We do tend to make them match where possible |
llvm/include/llvm/Support/KnownBits.h | ||
---|---|---|
316 |
Dunno. @lattner gave reasons for the API of the member function APInt::concat in D109620. I'm not sure if those reasons also apply to a non-member version - i.e. should it take (hi, lo) instead of (lo, hi)? Personally I prefer the (lo, hi) order. |
Yeah, I strongly think we should keep these consistent. At the same time, I don't care which design wins, feel free to pick which approach makes most sense to you.
Maybe just return { Hi.Zero.concat(Lo.Zero), Hi.One.concat(Lo.One) }?