[llvm] Use named values in tests. (PR #182102)

Marcos Maronas via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 18 11:00:02 PST 2026


https://github.com/maarquitos14 created https://github.com/llvm/llvm-project/pull/182102

Address https://github.com/llvm/llvm-project/pull/181695#discussion_r2821774068.

>From cb4d664b61f0a75c2d2ea8f4ccc8840f013b2f91 Mon Sep 17 00:00:00 2001
From: Marcos Maronas <mmaronas at amd.com>
Date: Wed, 18 Feb 2026 12:59:05 -0600
Subject: [PATCH] Use named values in tests.

---
 .../ConstProp/vector-type-constant-folding.ll          | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/llvm/test/Transforms/InstSimplify/ConstProp/vector-type-constant-folding.ll b/llvm/test/Transforms/InstSimplify/ConstProp/vector-type-constant-folding.ll
index 5b12fd3ec545f..6c3289aeaf7ff 100644
--- a/llvm/test/Transforms/InstSimplify/ConstProp/vector-type-constant-folding.ll
+++ b/llvm/test/Transforms/InstSimplify/ConstProp/vector-type-constant-folding.ll
@@ -15,11 +15,11 @@ define void @test() {
 ; CHECK-NEXT:    store <4 x i16> <i16 sub (i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 0), i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 0)), i16 sub (i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 1), i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 1)), i16 sub (i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 2), i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 2)), i16 sub (i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 3), i16 extractelement (<4 x i16> bitcast (i64 ptrtoint (ptr @f to i64) to <4 x i16>), i32 3))>, ptr @f, align 8
 ; CHECK-NEXT:    ret void
 ;
-  %1 = ptrtoint ptr @f to i64
-  %2 = bitcast i64 %1 to <4 x i16>
-  %3 = ptrtoint ptr @f to i64
-  %4 = bitcast i64 %3 to <4 x i16>
-  %sub = sub <4 x i16> %2, %4
+  %a_i64 = ptrtoint ptr @f to i64
+  %a_vec4 = bitcast i64 %a_i64 to <4 x i16>
+  %b_i64 = ptrtoint ptr @f to i64
+  %b_vec4 = bitcast i64 %b_i64 to <4 x i16>
+  %sub = sub <4 x i16> %a_vec4, %b_vec4
   store <4 x i16> %sub, ptr @f, align 8
   ret void
 }



More information about the llvm-commits mailing list