[llvm-branch-commits] [llvm] e99ee06 - [X86] Reject fpsr in inline asm constraints other than clobber.

Craig Topper via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 27 16:44:45 PST 2023


Author: Craig Topper
Date: 2023-11-22T18:59:41-08:00
New Revision: e99ee06400404d3058e6f379465b9ac50aedb74c

URL: https://github.com/llvm/llvm-project/commit/e99ee06400404d3058e6f379465b9ac50aedb74c
DIFF: https://github.com/llvm/llvm-project/commit/e99ee06400404d3058e6f379465b9ac50aedb74c.diff

LOG: [X86] Reject fpsr in inline asm constraints other than clobber.

Fixes #73197 and #69201.

Added: 
    

Modified: 
    llvm/lib/Target/X86/X86ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 05a2ab093bb86f9..99866c811eb6faf 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -57236,7 +57236,8 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
       return std::make_pair(X86::DF, &X86::DFCCRRegClass);
 
     // fpsr -> FPSW
-    if (StringRef("{fpsr}").equals_insensitive(Constraint))
+    // Only allow for clobber.
+    if (StringRef("{fpsr}").equals_insensitive(Constraint) && VT == MVT::Other)
       return std::make_pair(X86::FPSW, &X86::FPCCRRegClass);
 
     return Res;


        


More information about the llvm-branch-commits mailing list