This is an archive of the discontinued LLVM Phabricator instance.

[LV] Move exact FP math check out of Requirements.
ClosedPublic

Authored by fhahn on Mar 15 2021, 8:42 AM.

Details

Summary

We know if the loop contains FP instructions preventing vectorization
after we are done with legality checks. This patch updates the code the
check for un-vectorizable FP operations earlier, to avoid unnecessarily
running the cost model and picking a vectorization factor. It also makes
the code more direct and moves the check to a position where similar
checks are done.

I might be missing something, but I don't see any reason to handle this
check differently to other, similar checks.

Diff Detail

Event Timeline

fhahn created this revision.Mar 15 2021, 8:42 AM
fhahn requested review of this revision.Mar 15 2021, 8:42 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2021, 8:42 AM

Not familiar enough with the code, but it totally makes sense to me, thanks!

llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll
224–237

I'm guessing the test needs to change so that the LV cost model is still constructed and printed?
I think you can just commit this as NFC.

fhahn updated this revision to Diff 332685.Mar 23 2021, 8:37 AM

Ping :)

Rebased, committed test change separately

llvm/test/Transforms/LoopVectorize/PowerPC/reg-usage.ll
224–237

Yes exactly. I did just that in 7fb6d9f9588f, thanks!

This revision is now accepted and ready to land.Mar 23 2021, 8:41 AM
This revision was automatically updated to reflect the committed changes.