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

Steffen Larsen via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 4 05:03:27 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());
----------------
steffenlarsen wrote:

Good shout! I was not aware of it, but it's in there now. Additionally, I did some simplifications around these parts.

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


More information about the llvm-commits mailing list