[llvm] [AMDGPU] Add half vector support for table-driven libcall optimization (PR #178638)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 4 04:39:02 PST 2026


================
@@ -743,6 +743,26 @@ bool AMDGPULibCalls::fold(CallInst *CI) {
   return false;
 }
 
+static Constant *
+getConstantFloatVectorForArgType(LLVMContext &Ctx, AMDGPULibFunc::EType ArgType,
+                                 const ArrayRef<APFloat> Values,
+                                 const Type *Ty) {
+  SmallVector<Constant *, 4> ConstValues;
+  ConstValues.reserve(Values.size());
+  for (const APFloat &APF : Values) {
+    APFloat APFCopy = APF;
+    const auto &FltSem =
+        ArgType == AMDGPULibFunc::F16
+            ? APFloat::IEEEhalf()
+            : (ArgType == AMDGPULibFunc::F32 ? APFloat::IEEEsingle()
+                                             : APFloat::IEEEdouble());
----------------
arsenm wrote:

Just use Ty->getScalarType()->getFltSemantics()? No sense in figuring out the semantics from the ArgType

https://github.com/llvm/llvm-project/pull/178638


More information about the llvm-commits mailing list