[PATCH] D108612: [X86] Building constant vector which element type is half will cause assertion fail.

Pengfei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 23 23:12:00 PDT 2021


pengfei added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:9009
     if (VT.isFloatingPoint()) {
-      if (ScalarSize == 32) {
+      if (ScalarSize == 16)
+        Const = ConstantFP::get(C, APFloat(APFloat::IEEEhalf(), Val));
----------------
Add parentheses to align the format.


================
Comment at: llvm/test/CodeGen/X86/build_fp16_constant_vector.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512fp16 | FileCheck %s --check-prefixes=CHECK-32
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512fp16 | FileCheck %s --check-prefixes=CHECK-64
----------------
Maybe we don't need it?


================
Comment at: llvm/test/CodeGen/X86/build_fp16_constant_vector.ll:3
+; RUN: llc < %s -mtriple=i686-unknown-unknown -mattr=+avx512fp16 | FileCheck %s --check-prefixes=CHECK-32
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512fp16 | FileCheck %s --check-prefixes=CHECK-64
+
----------------
ditto.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108612/new/

https://reviews.llvm.org/D108612



More information about the llvm-commits mailing list