[llvm] [AMDGPU][True16][CodeGen] Undo sub(x, c) to add in true16 flow (PR #118854)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 15:08:47 PST 2024


================
@@ -1271,7 +1271,11 @@ let True16Predicate = NotHasTrue16BitInsts, SubtargetPredicate = isGFX10Plus in
 let True16Predicate = UseRealTrue16Insts in {
   def : OpSelBinOpClampPat<uaddsat, V_ADD_NC_U16_t16_e64>;
   def : OpSelBinOpClampPat<usubsat, V_SUB_NC_U16_t16_e64>;
-} // End OtherPredicates = [UseRealTrue16Insts]
+  def : GCNPat<
+    (add i16:$src0, (i16 NegSubInlineIntConst16:$src1)),
+    (V_SUB_NC_U16_t16_e64 0, VSrc_b16:$src0, 0, NegSubInlineIntConst16:$src1, 0, 0)
----------------
arsenm wrote:

Missing test changes 

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


More information about the llvm-commits mailing list