Add a convenience method to copy wrapping, exact, and fast-math flags (NFC).
authorSanjay Patel <spatel@rotateright.com>
Mon, 1 Sep 2014 18:44:57 +0000 (18:44 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 1 Sep 2014 18:44:57 +0000 (18:44 +0000)
commit73f8eff19e3b0d92ec41a4857b487e713b5e02b8
tree7698bc1c7b1e4af4fbd846821e9e065fb89df4c6
parent88350bf61dea89d0e85af4be3dd703d89afb9243
Add a convenience method to copy wrapping, exact, and fast-math flags (NFC).

The loop vectorizer preserves wrapping, exact, and fast-math properties of scalar instructions.
This patch adds a convenience method to make that operation easier because we need to do this
in the loop vectorizer, SLP vectorizer, and possibly other places.

Although this is a 'no functional change' patch, I've added a testcase to verify that the exact
flag is preserved by the loop vectorizer. The wrapping and fast-math flags are already checked
in existing testcases.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216886 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/InstrTypes.h
lib/IR/Instructions.cpp
lib/Transforms/Vectorize/LoopVectorize.cpp
test/Transforms/LoopVectorize/exact.ll [new file with mode: 0644]