Fixes PR36532
Differential Revision: https://reviews.llvm.org/D43960
llvm-svn: 326596
return Res;
}
+ // Make sure it isn't a register that requires AVX512.
+ if (!Subtarget.hasAVX512() && isFRClass(*Res.second) &&
+ TRI->getEncodingValue(Res.first) & 0x10) {
+ // Register requires EVEX prefix.
+ Res.first = 0;
+ Res.second = nullptr;
+ return Res;
+ }
+
// Otherwise, check to see if this is a register class of the wrong value
// type. For example, we want to map "{ax},i32" -> {eax}, we don't want it to
// turn into {ax},{dx}.
--- /dev/null
+; RUN: not llc -o /dev/null %s 2>&1 | FileCheck %s
+target triple = "x86_64--"
+
+; CHECK: error: couldn't allocate output register for constraint '{xmm16}'
+define i64 @blup() {
+ %v = tail call i64 asm "", "={xmm16},0"(i64 0)
+ ret i64 %v
+}