[llvm] a206f85 - [X86] Reject dirflag in inline asm constraints other than clobber.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 16 23:34:08 PDT 2020
Author: Craig Topper
Date: 2020-08-16T23:33:45-07:00
New Revision: a206f8509124c483358eb6e80e08bf621efd7655
URL: https://github.com/llvm/llvm-project/commit/a206f8509124c483358eb6e80e08bf621efd7655
DIFF: https://github.com/llvm/llvm-project/commit/a206f8509124c483358eb6e80e08bf621efd7655.diff
LOG: [X86] Reject dirflag in inline asm constraints other than clobber.
Fixes the crash from PR47195.
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 961fd08858b4..05da59983677 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -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
More information about the llvm-commits
mailing list