[llvm] 309e41d - [DAG] Add test coverage for Issue #66603
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 19 05:29:11 PDT 2023
Author: Simon Pilgrim
Date: 2023-10-19T13:28:52+01:00
New Revision: 309e41dd1358cc61027358afa861ecb06b1942c9
URL: https://github.com/llvm/llvm-project/commit/309e41dd1358cc61027358afa861ecb06b1942c9
DIFF: https://github.com/llvm/llvm-project/commit/309e41dd1358cc61027358afa861ecb06b1942c9.diff
LOG: [DAG] Add test coverage for Issue #66603
Added:
llvm/test/CodeGen/AArch64/pr66603.ll
llvm/test/CodeGen/RISCV/pr66603.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/AArch64/pr66603.ll b/llvm/test/CodeGen/AArch64/pr66603.ll
new file mode 100644
index 000000000000000..61c2ada86744fc7
--- /dev/null
+++ b/llvm/test/CodeGen/AArch64/pr66603.ll
@@ -0,0 +1,13 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
+; RUN: llc < %s -mtriple=aarch64-- -verify-machineinstrs | FileCheck %s
+
+define i32 @PR66603(double %x) nounwind {
+; CHECK-LABEL: PR66603:
+; CHECK: // %bb.0:
+; CHECK-NEXT: fcvtzs w0, d0
+; CHECK-NEXT: ret
+ %as_i8 = fptosi double %x to i8
+ %frozen_i8 = freeze i8 %as_i8
+ %ext = sext i8 %frozen_i8 to i32
+ ret i32 %ext
+}
diff --git a/llvm/test/CodeGen/RISCV/pr66603.ll b/llvm/test/CodeGen/RISCV/pr66603.ll
new file mode 100644
index 000000000000000..b92f1239cc17e9c
--- /dev/null
+++ b/llvm/test/CodeGen/RISCV/pr66603.ll
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
+; RUN: llc < %s -mtriple=riscv32-- -mattr=+d -verify-machineinstrs | FileCheck %s -check-prefix=RV32
+; RUN: llc < %s -mtriple=riscv64-- -mattr=+d -verify-machineinstrs | FileCheck %s -check-prefix=RV64
+
+define i32 @PR66603(double %x) nounwind {
+; RV32-LABEL: PR66603:
+; RV32: # %bb.0:
+; RV32-NEXT: fcvt.w.d a0, fa0, rtz
+; RV32-NEXT: ret
+;
+; RV64-LABEL: PR66603:
+; RV64: # %bb.0:
+; RV64-NEXT: fcvt.l.d a0, fa0, rtz
+; RV64-NEXT: ret
+ %as_i8 = fptosi double %x to i8
+ %frozen_i8 = freeze i8 %as_i8
+ %ext = sext i8 %frozen_i8 to i32
+ ret i32 %ext
+}
More information about the llvm-commits
mailing list