[llvm] AMDGPU: Fix packed 16-bit inline constants (PR #76522)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 20:51:57 PST 2024


Nicolai =?utf-8?q?Hähnle?= <nicolai.haehnle at amd.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/76522 at github.com>


================
@@ -125,15 +125,6 @@ defm V_PK_LSHRREV_B16 : VOP3PInst<"v_pk_lshrrev_b16", VOP3P_Profile<VOP_V2I16_V2
 
 let SubtargetPredicate = HasVOP3PInsts in {
 
-// Undo sub x, c -> add x, -c canonicalization since c is more likely
-// an inline immediate than -c.
-// The constant will be emitted as a mov, and folded later.
-// TODO: We could directly encode the immediate now
-def : GCNPat<
-  (add (v2i16 (VOP3PMods v2i16:$src0, i32:$src0_modifiers)), NegSubInlineConstV216:$src1),
-  (V_PK_SUB_U16 $src0_modifiers, $src0, SRCMODS.OP_SEL_1, NegSubInlineConstV216:$src1)
->;
-
----------------
arsenm wrote:

Removing this here is somewhat unfortunate, since the packed and non-packed cases are now handled differently. Is there a real reason to move this? I guess it doesn't really matter 

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


More information about the llvm-commits mailing list