OSDN Git Service

[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)
commitbf0554faf158739f921ad8c8ccacc17a3bfc4374
tree4ec24e0f45d298d4830954938336731a4aecdf82
parent4adc4526ec1d024d4ebe4e4d51572cee29b3102e
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327152 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/GlobalISel/MIPatternMatch.h
include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h
include/llvm/CodeGen/GlobalISel/Utils.h
lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
lib/CodeGen/GlobalISel/Utils.cpp
unittests/CodeGen/GlobalISel/PatternMatchTest.cpp