[llvm] [GISel] Unify multiple instances of getTypeForLLT (NFC) (PR #95577)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 11:13:39 PDT 2024


================
@@ -1906,3 +1906,10 @@ bool llvm::isGuaranteedNotToBeUndef(Register Reg,
   return ::isGuaranteedNotToBeUndefOrPoison(Reg, MRI, Depth,
                                             UndefPoisonKind::UndefOnly);
 }
+
+Type *llvm::getTypeForLLT(LLT Ty, LLVMContext &C) {
+  if (Ty.isVector())
+    return FixedVectorType::get(IntegerType::get(C, Ty.getScalarSizeInBits()),
+                                Ty.getNumElements());
----------------
arsenm wrote:

Use VectorType and getElementCount 

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


More information about the llvm-commits mailing list