[llvm] [LLVM] Add `Type::getTruncatedType()` and use it in Intrinsics.cpp (PR #196239)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 05:49:40 PDT 2026


================
@@ -67,7 +67,15 @@ class IntegerType : public Type {
 
   /// Returns type twice as wide the input type.
   IntegerType *getExtendedType() const {
-    return Type::getIntNTy(getContext(), 2 * getScalarSizeInBits());
+    return Type::getIntNTy(getContext(), 2 * getBitWidth());
+  }
+
+  /// Returns type half as wide the input type.
+  IntegerType *getTruncatedType() const {
----------------
jurahul wrote:

I'll put up a PR in any case with the new names and we can see if we like it or not. 

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


More information about the llvm-commits mailing list