OSDN Git Service

Preserve IR flags (nsw, nuw, exact, fast-math) in SLP vectorizer (PR20802).
authorSanjay Patel <spatel@rotateright.com>
Wed, 3 Sep 2014 17:40:30 +0000 (17:40 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 3 Sep 2014 17:40:30 +0000 (17:40 +0000)
commitb89304eb7cd1ab2cf0692783485f593d15f3222b
tree50ddd78d152d73dfdf88b4b8478dcba7aa1fbb48
parent6d66a1cd2f6c47361bb9f294d7d2af1530f27914
Preserve IR flags (nsw, nuw, exact, fast-math) in SLP vectorizer (PR20802).

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.

Differential Revision: http://reviews.llvm.org/D5172

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217051 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
lib/Transforms/Vectorize/SLPVectorizer.cpp
test/Transforms/SLPVectorizer/AArch64/commute.ll
test/Transforms/SLPVectorizer/ARM/sroa.ll
test/Transforms/SLPVectorizer/X86/addsub.ll
test/Transforms/SLPVectorizer/X86/cycle_dup.ll
test/Transforms/SLPVectorizer/X86/hoist.ll
test/Transforms/SLPVectorizer/X86/horizontal.ll
test/Transforms/SLPVectorizer/X86/loopinvariant.ll
test/Transforms/SLPVectorizer/X86/multi_user.ll
test/Transforms/SLPVectorizer/X86/powof2div.ll
test/Transforms/SLPVectorizer/X86/propagate_ir_flags.ll [new file with mode: 0644]
test/Transforms/SLPVectorizer/X86/saxpy.ll
test/Transforms/SLPVectorizer/X86/scheduling.ll