[SimplifyCFG] propagate fast-math-flags (FMF) from phi to select
authorSanjay Patel <spatel@rotateright.com>
Sun, 17 Nov 2019 16:23:44 +0000 (11:23 -0500)
committerSanjay Patel <spatel@rotateright.com>
Sun, 17 Nov 2019 16:23:44 +0000 (11:23 -0500)
commitebf9bf2cbc8fa68d536e481e370c4ba40ce61a8a
tree32eb0ae80a2bc8e698052dfeb287358abe3a27f5
parent23f736059c704b95643dfc63425444044b57a973
[SimplifyCFG] propagate fast-math-flags (FMF) from phi to select

Similar to/extension of D70208 (rGee0882bdf866), but this one
may finally allow closing motivating bugs.

This is another step towards having FMF apply only to FP values
rather than those + fcmp. See PR38086 for one of the original
discussions/motivations:
https://bugs.llvm.org/show_bug.cgi?id=38086

And the test here is derived from PR39535:
https://bugs.llvm.org/show_bug.cgi?id=39535

Currently, we lose FMF when converting any phi to select in
SimplifyCFG. There are a small number of similar changes needed
to correct within SimplifyCFG, so it should be quick to patch
this pass up.

FMF was extended to select and phi with:
D61917
D67564
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/speculate-math.ll