[llvm] [LLVM][IR] Add native vector support to ConstantInt & ConstantFP. (PR #74502)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 08:49:35 PST 2024


================
@@ -1444,6 +1460,10 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
         // Reparse stringized version!
         if (APFloat(APFloat::IEEEdouble(), StrVal).convertToDouble() == Val) {
           Out << StrVal;
+
+          if (CFP->getType()->isVectorTy())
+            Out << ")";
----------------
nikic wrote:

The fact that this has to be repeated in a bunch of branches is not great -- might make sense to factor out the core APFloat printing out of this function?

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


More information about the llvm-commits mailing list