Skip to content

Commit

Permalink
[X86] Reject fpsr in inline asm constraints other than clobber.
Browse files Browse the repository at this point in the history
Fixes #73197 and #69201.
  • Loading branch information
topperc committed Nov 23, 2023
1 parent b16f765 commit e99ee06
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Target/X86/X86ISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit e99ee06

Please sign in to comment.