Implementation of D114590 for the AArch64 backend. Specifying the loop alignment and the max padding permitted for the neoverse-n1, -n2, and -v1 subtargets
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
2 | The alignments in AArch64 are usually set in MachineBlockPlacement::alignBlocks, which is probably the more general place for this. The alignments can then be set in the same places as setPrefLoopAlignment for each backend. Maybe at the moment, before we've fixed on proper values for AArch64 cpus, we could use an option as a way of testing that the values are getting propagated correctly. |
Do we want this to work the same way as PrefFunctionLogAlignment from AArch64, being set in the subtarget per cpu? Do you have a motivating cpu that we can start to make work immediately? I'm not sure I understand the code here at the moment.
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
2 | Do we need to override this method, or can it work more consistently like TargetLoweringBase::setPrefLoopAlignment and getPrefLoopAlignment? That way we can set the value in AArch64TargetLowering::AArch64TargetLowering like we already do for other loop alignments, and keep everything together. The (LoopAlign, MaxBytesForLoopAlign) can be thought of as a pair. I think it makes sense to keep them as separate variables, but ideally they are set and used together. | |
llvm/test/CodeGen/AArch64/aarch64-p2align-max-bytes-neoverse.ll | ||
12 | This file needn't have the objfile checks, so long as they are tested elsewhere. |
The alignments in AArch64 are usually set in MachineBlockPlacement::alignBlocks, which is probably the more general place for this. The alignments can then be set in the same places as setPrefLoopAlignment for each backend.
Maybe at the moment, before we've fixed on proper values for AArch64 cpus, we could use an option as a way of testing that the values are getting propagated correctly.