This is an archive of the discontinued LLVM Phabricator instance.

Preserve IR flags (nsw, nuw, exact, fast-math) in SLP vectorizer (PR20802)
ClosedPublic

Authored by spatel on Sep 3 2014, 9:01 AM.

Details

Summary

The SLP vectorizer should propagate IR-level optimization hints/flags (nsw, nuw, exact, fast-math) when converting scalar instructions into vectors. But this isn't a simple copy - we need to take the intersection (the logical 'and') of the sets of flags on the scalars.

The solution is further complicated because we can have non-uniform (non-SIMD) vector ops after:
http://reviews.llvm.org/D4015
http://llvm.org/viewvc/llvm-project?view=revision&revision=211339

The vast majority of changed files are existing tests that were not propagating IR flags, but I've also added a new test file for focused testing of IR flag possibilities.

Diff Detail

Event Timeline

spatel updated this revision to Diff 13212.Sep 3 2014, 9:01 AM
spatel retitled this revision from to Preserve IR flags (nsw, nuw, exact, fast-math) in SLP vectorizer (PR20802).
spatel updated this object.
spatel edited the test plan for this revision. (Show Details)
spatel added a subscriber: Unknown Object (MLST).
nadav edited edge metadata.Sep 3 2014, 9:29 AM

LGTM! Thanks Sanjay!

spatel closed this revision.Sep 3 2014, 10:50 AM
spatel updated this revision to Diff 13218.

Closed by commit rL217051 (authored by @spatel).