[LoopUtils][SLPVectorizer] clean up management of fast-math-flags
authorSanjay Patel <spatel@rotateright.com>
Wed, 5 Jun 2019 14:58:04 +0000 (14:58 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 5 Jun 2019 14:58:04 +0000 (14:58 +0000)
commitad62a3a2992744dc9e16fcb248841d7e27be3b7e
tree5cd2f26f0ee056cc727cd128bb25312e933e5f12
parent7ca9b978c4f4c7ecf652cac0c900b074d8dc48d7
[LoopUtils][SLPVectorizer] clean up management of fast-math-flags

Instead of passing around fast-math-flags as a parameter, we can set those
using an IRBuilder guard object. This is no-functional-change-intended.

The motivation is to eventually fix the vectorizers to use and set the
correct fast-math-flags for reductions. Examples of that not behaving as
expected are:
https://bugs.llvm.org/show_bug.cgi?id=23116 (should be able to reduce with less than 'fast')
https://bugs.llvm.org/show_bug.cgi?id=35538 (possible miscompile for -0.0)
D61802 (should be able to reduce with IR-level FMF)

Differential Revision: https://reviews.llvm.org/D62272

llvm-svn: 362612
llvm/include/llvm/Transforms/Utils/LoopUtils.h
llvm/lib/CodeGen/ExpandReductions.cpp
llvm/lib/Transforms/Utils/LoopUtils.cpp
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp