[GISel] Add new combines for unary FP instrs with constant operand
authorMichael Kitzan <mkitzan@apple.com>
Sat, 22 Aug 2020 06:11:22 +0000 (23:11 -0700)
committerMichael Kitzan <mkitzan@apple.com>
Wed, 16 Sep 2020 17:34:15 +0000 (10:34 -0700)
commitc4e589b7954c4e202474ce4a2101f07014792835
tree5980ea487a819faae499747f8b3923d68e1c1d70
parent8f7d6b2375618a79f621d5484e44870ede335a13
[GISel] Add new combines for unary FP instrs with constant operand

https://reviews.llvm.org/D86393

Patch adds five new `GICombinerRules`, one for each of the following unary
FP instrs: `G_FNEG`, `G_FABS`, `G_FPTRUNC`, `G_FSQRT`, and `G_FLOG2`. The
combine rules perform the FP operation on the constant operand and replace
the original instr with the result. Patch additionally adds new combiner
tests for the AArch64 target to test these new combiner rules.
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/CodeGen/LowLevelType.h
llvm/include/llvm/Target/GlobalISel/Combine.td
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/CodeGen/LowLevelType.cpp
llvm/test/CodeGen/AArch64/GlobalISel/combine-fabs.mir
llvm/test/CodeGen/AArch64/GlobalISel/combine-flog2.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/GlobalISel/combine-fneg.mir
llvm/test/CodeGen/AArch64/GlobalISel/combine-fptrunc.mir [new file with mode: 0644]
llvm/test/CodeGen/AArch64/GlobalISel/combine-fsqrt.mir [new file with mode: 0644]