if (!S)
return nullptr;
+ // If the pointer is invariant then there is no stride and it makes no
+ // sense to add it here.
+ if (Lp != S->getLoop())
+ return nullptr;
+
V = S->getStepRecurrence(*SE);
if (!V)
return nullptr;
define void @foo(ptr %pout, ptr %pin, i64 %val0, i64 %val1, i64 %val2) {
; CHECK-LABEL: @foo(
-; FIXME: CHECK below needs to be changed to CHECK-NOT to confirm the change.
-; CHECK: vector.scevcheck
+; CHECK-NOT: vector.scevcheck
; CHECK: vector.body
entry:
%0 = getelementptr double, ptr %pin, i64 %val0
define void @bar(ptr %pout, ptr %pin, i64 %val0, i64 %val1, i64 %val2) {
; CHECK-LABEL: @bar(
-; FIXME: CHECK below needs to be changed to CHECK-NOT to confirm the change.
-; CHECK: vector.scevcheck
+; CHECK-NOT: vector.scevcheck
; CHECK: vector.body
entry:
%0 = getelementptr double, ptr %pin, i64 %val0