Skip to content

Commit 9bb9ff0

Browse files
committed
[X86] Remove incomplete support for 'Y' has an inline assembly constraint by itself.
Y is the start of several 2 letter constraints, but we also had partial support to recognize it by itself. But it doesn't look like it can get through clang as a single letter so the backend support for this was effectively dead.
1 parent 880115e commit 9bb9ff0

File tree

2 files changed

+7
-18
lines changed

2 files changed

+7
-18
lines changed

clang/lib/Basic/Targets/X86.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1916,7 +1916,7 @@ bool X86TargetInfo::validateOperandSize(const llvm::StringMap<bool> &FeatureMap,
19161916
return false;
19171917
break;
19181918
}
1919-
LLVM_FALLTHROUGH;
1919+
break;
19201920
case 'v':
19211921
case 'x':
19221922
if (FeatureMap.lookup("avx512f"))

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -47980,7 +47980,6 @@ X86TargetLowering::getConstraintType(StringRef Constraint) const {
4798047980
case 'y':
4798147981
case 'x':
4798247982
case 'v':
47983-
case 'Y':
4798447983
case 'l':
4798547984
case 'k': // AVX512 masking registers.
4798647985
return C_RegisterClass;
@@ -48073,13 +48072,10 @@ TargetLowering::ConstraintWeight
4807348072
if (type->isX86_MMXTy() && Subtarget.hasMMX())
4807448073
weight = CW_SpecificReg;
4807548074
break;
48076-
case 'Y': {
48077-
unsigned Size = StringRef(constraint).size();
48078-
// Pick 'i' as the next char as 'Yi' and 'Y' are synonymous, when matching 'Y'
48079-
char NextChar = Size == 2 ? constraint[1] : 'i';
48080-
if (Size > 2)
48075+
case 'Y':
48076+
if (StringRef(constraint).size() != 2)
4808148077
break;
48082-
switch (NextChar) {
48078+
switch (constraint[1]) {
4808348079
default:
4808448080
return CW_Invalid;
4808548081
// XMM0
@@ -48100,17 +48096,15 @@ TargetLowering::ConstraintWeight
4810048096
if (type->isX86_MMXTy() && Subtarget.hasMMX())
4810148097
return weight;
4810248098
return CW_Invalid;
48103-
// Any SSE reg when ISA >= SSE2, same as 'Y'
48099+
// Any SSE reg when ISA >= SSE2, same as 'x'
4810448100
case 'i':
4810548101
case 't':
4810648102
case '2':
4810748103
if (!Subtarget.hasSSE2())
4810848104
return CW_Invalid;
4810948105
break;
4811048106
}
48111-
// Fall through (handle "Y" constraint).
48112-
LLVM_FALLTHROUGH;
48113-
}
48107+
break;
4811448108
case 'v':
4811548109
if ((type->getPrimitiveSizeInBits() == 512) && Subtarget.hasAVX512())
4811648110
weight = CW_Register;
@@ -48192,8 +48186,6 @@ LowerXConstraint(EVT ConstraintVT) const {
4819248186
// FP X constraints get lowered to SSE1/2 registers if available, otherwise
4819348187
// 'f' like normal targets.
4819448188
if (ConstraintVT.isFloatingPoint()) {
48195-
if (Subtarget.hasSSE2())
48196-
return "Y";
4819748189
if (Subtarget.hasSSE1())
4819848190
return "x";
4819948191
}
@@ -48492,9 +48484,6 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
4849248484
case 'y': // MMX_REGS if MMX allowed.
4849348485
if (!Subtarget.hasMMX()) break;
4849448486
return std::make_pair(0U, &X86::VR64RegClass);
48495-
case 'Y': // SSE_REGS if SSE2 allowed
48496-
if (!Subtarget.hasSSE2()) break;
48497-
LLVM_FALLTHROUGH;
4849848487
case 'v':
4849948488
case 'x': // SSE_REGS if SSE1 allowed or AVX_REGS if AVX allowed
4850048489
if (!Subtarget.hasSSE1()) break;
@@ -48557,7 +48546,7 @@ X86TargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
4855748546
case 'i':
4855848547
case 't':
4855948548
case '2':
48560-
return getRegForInlineAsmConstraint(TRI, "Y", VT);
48549+
return getRegForInlineAsmConstraint(TRI, "x", VT);
4856148550
case 'm':
4856248551
if (!Subtarget.hasMMX()) break;
4856348552
return std::make_pair(0U, &X86::VR64RegClass);

0 commit comments

Comments
 (0)