[PATCH] D154075: [LoopVectorize] Add pre-commit tests for D152366
David Sherwood via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 25 08:17:30 PDT 2023
david-arm added a comment.
> - inner and outer inductions decreasing (constant step)
Hi @fhahn, perhaps I'm missing something but the runtime checks already look broken to me for decreasing IVs in the inner loop:
#include <stdint.h>
void decreasing_inner_iv(int32_t *dst, int32_t *src, int m, int n) {
for (int i = 0; i < m; i++) {
for (int j = n - 1; j >= 0; j--) {
dst[(i * (n + 1)) + j] += src[(i * n) + j];
}
}
}
These are the SCEVs for the checks:
LAA: Adding RT check for range:
Start: {%dst,+,(4 * (zext i32 (1 + %n) to i64))<nuw><nsw>}<%for.cond1.preheader.us> End: {((4 * (zext i32 %n to i64))<nuw><nsw> + %dst),+,(4 * (zext i32 (1 + %n) to i64))<nuw><nsw>}<%for.co
nd1.preheader.us>
LAA: Adding RT check for range:
Start: {%src,+,(4 * (zext i32 %n to i64))<nuw><nsw>}<%for.cond1.preheader.us> End: {((4 * (zext i32 %n to i64))<nuw><nsw> + %src),+,(4 * (zext i32 %n to i64))<nuw><nsw>}<%for.cond1.preheade
r.us>
Calculating cost of runtime checks:
1 for %bound0 = icmp ult ptr %scevgep, %scevgep36
1 for %bound1 = icmp ult ptr %scevgep35, %scevgep34
1 for %found.conflict = and i1 %bound0, %bound1
I don't see how the Start and End values correspond to actual range of addresses accessed in the inner loop?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154075/new/
https://reviews.llvm.org/D154075
More information about the llvm-commits
mailing list