[GISel]: Add helpers for easy building G_FCONSTANT along with matchers
authorAditya Nandakumar <aditya_nandakumar@apple.com>
Fri, 9 Mar 2018 17:31:51 +0000 (17:31 +0000)
committerAditya Nandakumar <aditya_nandakumar@apple.com>
Fri, 9 Mar 2018 17:31:51 +0000 (17:31 +0000)
commit91fc4e09499c24e9184853e9a53a953bdea8a356
tree2ecf5eaad712fa1bda8e20854ff909d8b98c559f
parent2e55ee77e2b9f0d13d4a85852059d258a697cc5c
[GISel]: Add helpers for easy building G_FCONSTANT along with matchers

Added helpers to build G_FCONSTANT, along with matching ConstantFP and
unit tests for the same.

Sample usage.

auto MIB = Builder.buildFConstant(s32, 0.5); // Build IEEESingle
For Matching the above

const ConstantFP* Tmp;
mi_match(DstReg, MRI, m_GFCst(Tmp));

https://reviews.llvm.org/D44128
reviewed by: volkan

llvm-svn: 327152
llvm/include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
llvm/include/llvm/CodeGen/GlobalISel/Utils.h
llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
llvm/lib/CodeGen/GlobalISel/Utils.cpp
llvm/unittests/CodeGen/GlobalISel/PatternMatchTest.cpp