This is an archive of the discontinued LLVM Phabricator instance.

[test, LoopVectorize] Fix use of var defined in CHECK-NOT
ClosedPublic

Authored by thopre on Mar 30 2021, 5:52 AM.

Details

Summary

LLVM test Transforms/LoopVectorize/pr34681.ll tries to check for the
absence of a sequence of instructions with several CHECK-NOT with one of
those directives using a variable defined in another. However CHECK-NOT
are checked independently so that is using a variable defined in a
pattern that should not occur in the input.

This commit only checks for the absence of icmp ne 1 which rules out the
presence of the whole sequence and does not involve an undefined
variable.

Diff Detail

Event Timeline

thopre requested review of this revision.Mar 30 2021, 5:52 AM
thopre created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2021, 5:52 AM
thopre updated this revision to Diff 334154.Mar 30 2021, 6:59 AM

Simplify other CHECK-NOT

fhahn added a subscriber: fhahn.Apr 6 2021, 2:20 AM
fhahn added inline comments.
llvm/test/Transforms/LoopVectorize/pr34681.ll
27

what's the branch condition in this test? Could we check for the right one? Same below

thopre updated this revision to Diff 335476.Apr 6 2021, 4:17 AM
thopre marked an inline comment as done.

Keep checking each line

llvm/test/Transforms/LoopVectorize/pr34681.ll
27

We could do:

; CHECK-NOT: %ident.check = icmp ne i32 %N, 1{{(.*[[:space:]])+}}%[[TEST:[0-9]+]] = or i1 false, %ident.check{{(.*[[:space:]])+}}br i1 %[[TEST]], label %scalar.ph, label %vector.ph

but it's a lot less readable and thus more likely to have a bug in it. How about checking the absence of both icmp, or and br?

fhahn accepted this revision.Apr 9 2021, 1:10 AM

LGTM, thanks!

llvm/test/Transforms/LoopVectorize/pr34681.ll
27

How about checking the absence of both icmp, or and br?

That sounds good, thanks!

This revision is now accepted and ready to land.Apr 9 2021, 1:10 AM
This revision was landed with ongoing or failed builds.Apr 9 2021, 2:02 AM
This revision was automatically updated to reflect the committed changes.