Add an extra parameter so the backend can take the alignment into consideration. I'll need this to continue with D68337.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Seems very sensible to me. There is an Align object recently added to llvm. Should we make use of it here?
I saw that, but wasn't sure how to use it! The alignment is just an unsigned value at all the call sites, so that's why I went for that.
lib/Target/X86/X86TargetTransformInfo.h | ||
---|---|---|
189 ↗ | (On Diff #223033) | ", unsigned Alignment" :) Also the isLegalNTLoad below use the Align. I think they should be fairly simple to use (but haven't used them myself yet, just fixed merge conflicts). |
Yes, it turns out Align is simple to use, the constructor just takes the unsigned value... but it will not accept zero and so causes assertion failures.
I think that's what "MaybeAlign" is for, if I read it correctly. It is essentially an Optional<Align> with 0 alignments being the "false" optional state.
Thanks! LGTM
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
4543 | Does this need to be a MaybeAlign(Alignment)? Because the constructor is explicit, as far as I understand (hence, needs to look like the others). |
llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | ||
---|---|---|
4543 | These are the internal helper functions, so they're constructed explicitly there. lines 1172 and 1179. |
Does this need to be a MaybeAlign(Alignment)? Because the constructor is explicit, as far as I understand (hence, needs to look like the others).