[X86] Reject dirflag in inline asm constraints other than clobber.
authorCraig Topper <craig.topper@intel.com>
Mon, 17 Aug 2020 06:27:41 +0000 (23:27 -0700)
committerCraig Topper <craig.topper@intel.com>
Mon, 17 Aug 2020 06:33:45 +0000 (23:33 -0700)
Fixes the crash from PR47195.

llvm/lib/Target/X86/X86ISelLowering.cpp

index 961fd08..05da599 100644 (file)
@@ -50285,7 +50285,8 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
       return std::make_pair(X86::EFLAGS, &X86::CCRRegClass);
 
     // dirflag -> DF
-    if (StringRef("{dirflag}").equals_lower(Constraint))
+    // Only allow for clobber.
+    if (StringRef("{dirflag}").equals_lower(Constraint) && VT == MVT::Other)
       return std::make_pair(X86::DF, &X86::DFCCRRegClass);
 
     // fpsr -> FPSW