[llvm] r353720 - Recommit "[GlobalISel] Add IRTranslator support for G_FFLOOR"
Jessica Paquette via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 11 09:16:32 PST 2019
Author: paquette
Date: Mon Feb 11 09:16:32 2019
New Revision: 353720
URL: http://llvm.org/viewvc/llvm-project?rev=353720&view=rev
Log:
Recommit "[GlobalISel] Add IRTranslator support for G_FFLOOR"
After the changes introduced in r353586, this instruction doesn't cause any
issues for any backend.
Original review: https://reviews.llvm.org/D57485
Modified:
llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
Modified: llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp?rev=353720&r1=353719&r2=353720&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/IRTranslator.cpp Mon Feb 11 09:16:32 2019
@@ -808,6 +808,8 @@ IRTranslator::getSimpleUnaryIntrinsicOpc
return TargetOpcode::G_FABS;
case Intrinsic::canonicalize:
return TargetOpcode::G_FCANONICALIZE;
+ case Intrinsic::floor:
+ return TargetOpcode::G_FFLOOR;
case Intrinsic::log:
return TargetOpcode::G_FLOG;
case Intrinsic::log2:
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll?rev=353720&r1=353719&r2=353720&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll Mon Feb 11 09:16:32 2019
@@ -2334,6 +2334,14 @@ define float @test_sqrt_f32(float %x) {
ret float %y
}
+declare float @llvm.floor.f32(float)
+define float @test_floor_f32(float %x) {
+ ; CHECK-LABEL: name: test_floor_f32
+ ; CHECK: %{{[0-9]+}}:_(s32) = G_FFLOOR %{{[0-9]+}}
+ %y = call float @llvm.floor.f32(float %x)
+ ret float %y
+}
+
; CHECK-LABEL: name: test_llvm.aarch64.neon.ld3.v4i32.p0i32
; CHECK: %1:_(s384) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aarch64.neon.ld3), %0(p0) :: (load 48 from %ir.ptr, align 64)
define void @test_llvm.aarch64.neon.ld3.v4i32.p0i32(i32* %ptr) {
More information about the llvm-commits
mailing list