We have similar code to translate a demanded elements mask for a shuffle's operands in multiple places - this patch adds a helper function to VectorUtils and updates a number of locations to use it directly.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/VectorUtils.cpp | ||
---|---|---|
432–434 | Can we assert that SrcWidth == DemandedLHS.getBitWidth() == DemandedRHS.getBitWidth() ? |
llvm/lib/Analysis/VectorUtils.cpp | ||
---|---|---|
432–434 | Many of the the use cases we have we could technically get away with them being entirely uninitialized upon calling getShuffleDemandedElts - (a couple still initialize before calling getShuffleDemandedElts but its unnecessary). Which do you think is better? TBH I have no preference. |
llvm/lib/Analysis/VectorUtils.cpp | ||
---|---|---|
432–434 | Ah, I missed that this is now init'ing with getZero(). |
Make the initialization of DemandedLHS/RHS more explicit and remove local initializations
Can we assert that SrcWidth == DemandedLHS.getBitWidth() == DemandedRHS.getBitWidth() ?