Skip to content

[X86][NFC] - Remove fild/fist c++ predicates from patfrag #142562

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

Conversation

pawan-nirpal-031
Copy link
Contributor

@pawan-nirpal-031 pawan-nirpal-031 commented Jun 3, 2025

Drop the c++ predicates and use MemoryVT for memory size check for FILD and FIST.

@llvmbot
Copy link
Member

llvmbot commented Jun 3, 2025

@llvm/pr-subscribers-backend-x86

Author: Pawan Nirpal (pawan-nirpal-031)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/142562.diff

1 Files Affected:

  • (modified) llvm/lib/Target/X86/X86InstrFragments.td (+9-21)
diff --git a/llvm/lib/Target/X86/X86InstrFragments.td b/llvm/lib/Target/X86/X86InstrFragments.td
index 712492e474619..116986a0fffea 100644
--- a/llvm/lib/Target/X86/X86InstrFragments.td
+++ b/llvm/lib/Target/X86/X86InstrFragments.td
@@ -842,23 +842,17 @@ def X86fldf80 : PatFrag<(ops node:$ptr), (X86fld node:$ptr), [{
   return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::f80;
 }]>;
 
-def X86fild16 : PatFrag<(ops node:$ptr), (X86fild node:$ptr), [{
-  return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i16;
-}]> {
+def X86fild16 : PatFrag<(ops node:$ptr), (X86fild node:$ptr)> {
   let IsLoad = true;
   let MemoryVT = i16;
 }
 
-def X86fild32 : PatFrag<(ops node:$ptr), (X86fild node:$ptr), [{
-  return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i32;
-}]> {
+def X86fild32 : PatFrag<(ops node:$ptr), (X86fild node:$ptr)> {
   let IsLoad = true;
   let MemoryVT = i32;
 }
 
-def X86fild64 : PatFrag<(ops node:$ptr), (X86fild node:$ptr), [{
-  return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i64;
-}]> {
+def X86fild64 : PatFrag<(ops node:$ptr), (X86fild node:$ptr)> {
   let IsLoad = true;
   let MemoryVT = i64;
 }
@@ -873,26 +867,20 @@ def X86fist64 : PatFrag<(ops node:$val, node:$ptr),
   return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i64;
 }]>;
 
-def X86fp_to_i16mem : PatFrag<(ops node:$val, node:$ptr),
-                              (X86fp_to_mem node:$val, node:$ptr), [{
-  return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i16;
-}]> {
+def X86fp_to_i16mem
+    : PatFrag<(ops node:$val, node:$ptr), (X86fp_to_mem node:$val, node:$ptr)> {
   let IsStore = true;
   let MemoryVT = i16;
 }
 
-def X86fp_to_i32mem : PatFrag<(ops node:$val, node:$ptr),
-                              (X86fp_to_mem node:$val, node:$ptr), [{
-  return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i32;
-}]> {
+def X86fp_to_i32mem
+    : PatFrag<(ops node:$val, node:$ptr), (X86fp_to_mem node:$val, node:$ptr)> {
   let IsStore = true;
   let MemoryVT = i32;
 }
 
-def X86fp_to_i64mem : PatFrag<(ops node:$val, node:$ptr),
-                              (X86fp_to_mem node:$val, node:$ptr), [{
-  return cast<MemIntrinsicSDNode>(N)->getMemoryVT() == MVT::i64;
-}]> {
+def X86fp_to_i64mem
+    : PatFrag<(ops node:$val, node:$ptr), (X86fp_to_mem node:$val, node:$ptr)> {
   let IsStore = true;
   let MemoryVT = i64;
 }

@pawan-nirpal-031
Copy link
Contributor Author

@e-kud @arsenm @RKSimon could you please review.

@RKSimon RKSimon requested review from arsenm, e-kud and RKSimon June 3, 2025 09:03
Copy link
Collaborator

@RKSimon RKSimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - cheers

Copy link
Contributor

@e-kud e-kud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@e-kud e-kud merged commit 020ab69 into llvm:main Jun 3, 2025
13 checks passed
@pawan-nirpal-031 pawan-nirpal-031 deleted the fix-sdag-fild-predicate branch June 3, 2025 10:42
rorth pushed a commit to rorth/llvm-project that referenced this pull request Jun 11, 2025
Drop the c++ predicates and use MemoryVT for memory size check for FILD
and FIST.
DhruvSrivastavaX pushed a commit to DhruvSrivastavaX/lldb-for-aix that referenced this pull request Jun 12, 2025
Drop the c++ predicates and use MemoryVT for memory size check for FILD
and FIST.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants