[IRBuilder] Fix CreateFDivFMF ignoring source FMF
authorDaniel Woodworth <daniel.woodworth@intel.com>
Tue, 13 Dec 2022 10:35:17 +0000 (11:35 +0100)
committerNikita Popov <npopov@redhat.com>
Tue, 13 Dec 2022 10:35:17 +0000 (11:35 +0100)
commit4f3b1c6dd6ef6c7b5bb79f058e3b7ba4bcdf4566
tree8a51e602983559b85bdaf3f5b4d2d8a3a7ee1f63
parent5dbfca30c1a672cd0c5089df2b4fdd171436643a
[IRBuilder] Fix CreateFDivFMF ignoring source FMF

This change fixes a small bug in IRBuilderBase::CreateFDivFMF introduced
by accident in rGf34dcf27637f which caused the builder's default fast math
flags to be used for the new fdiv instruction instead of the ones from
the source instruction. It also adds unit testing for the CreateF*FMF
family of functions to more easily catch similar bugs in the future.

Differential Revision: https://reviews.llvm.org/D139583
llvm/include/llvm/IR/IRBuilder.h
llvm/unittests/IR/IRBuilderTest.cpp