[llvm] [X86][GlobalISel] - Legalize And Select of G_FPTOSI/G_SITOFP in X87 mode (PR #137377)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 09:21:11 PDT 2025


================
@@ -871,21 +871,21 @@ def X86fp_to_i16mem : PatFrag<(ops node:$val, node:$ptr),
                               (X86fp_to_mem node:$val, node:$ptr), [{
   return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i16;
 }]> {
-  let GISelPredicateCode = [{ return checkMemoryOpSize(MI, 2); }];
+  let GISelPredicateCode = [{ return checkMemoryOpSize(MI, LLT::scalar(16)); }];
----------------
arsenm wrote:

No, not the type of val, but the memory type for X86_fp_to_mem. Many of the common custom predicates were moved to specific fields on PatFrag that TableGen recognizes, like the memory alignment to avoid custom predicate code. This is how extending and atomic loads are specified, but the mechanism is supposed to be general. 

The example would be how atomic_load_32 and atomic_load_64 work, they each set MemoryVT and wrap another PatFrag for atomic_load, which in turn wraps a PatFrag around ld 


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


More information about the llvm-commits mailing list