Skip to content

Commit 30f7797

Browse files
committed
[LV] Address review
1 parent f63a025 commit 30f7797

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7488,6 +7488,8 @@ VPRecipeBuilder::tryToWidenMemory(Instruction *I, ArrayRef<VPValue *> Operands,
74887488
if (Reverse) {
74897489
// When folding the tail, we may compute an address that we don't in the
74907490
// original scalar loop: drop the GEP no-wrap flags in this case.
7491+
// Otherwise preserve existing flags without no-unsigned-wrap, as we will
7492+
// emit negative indices.
74917493
GEPNoWrapFlags Flags =
74927494
CM.foldTailByMasking() || !GEP
74937495
? GEPNoWrapFlags::none()

llvm/test/Transforms/LoopVectorize/reverse-induction-gep-nowrap-flags.ll

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt < %s -passes=loop-vectorize -force-vector-width=4 -S | FileCheck %s
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --check-globals none --version 6
2+
; RUN: opt -passes=loop-vectorize -force-vector-width=4 -S %s | FileCheck %s
33

44
define i32 @preserve_inbounds(i64 %start, ptr %ptr) {
55
; CHECK-LABEL: define i32 @preserve_inbounds(
@@ -180,10 +180,3 @@ loop:
180180
end:
181181
ret i32 %redux.next
182182
}
183-
;.
184-
; CHECK: [[LOOP0]] = distinct !{[[LOOP0]], [[META1:![0-9]+]], [[META2:![0-9]+]]}
185-
; CHECK: [[META1]] = !{!"llvm.loop.isvectorized", i32 1}
186-
; CHECK: [[META2]] = !{!"llvm.loop.unroll.runtime.disable"}
187-
; CHECK: [[LOOP3]] = distinct !{[[LOOP3]], [[META1]], [[META2]]}
188-
; CHECK: [[LOOP4]] = distinct !{[[LOOP4]], [[META1]], [[META2]]}
189-
;.

0 commit comments

Comments
 (0)