[clang] [llvm] [SelectionDAG] Fix assertion failure on inline asm register type mismatch (PR #166615)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 6 03:03:01 PST 2025


================
@@ -27,6 +27,17 @@ bool IsX86_MMXType(llvm::Type *IRType) {
 static llvm::Type *X86AdjustInlineAsmType(CodeGen::CodeGenFunction &CGF,
                                           StringRef Constraint,
                                           llvm::Type *Ty) {
+  bool IsMMXCons = llvm::StringSwitch<bool>(Constraint)
+                       .Cases({"y", "&y", "^Ym"}, true)
+                       .Default(false);
+  if (IsMMXCons && Ty->isVectorTy()) {
+    if (cast<llvm::VectorType>(Ty)->getPrimitiveSizeInBits().getFixedValue() !=
+        64) {
----------------
phoebewang wrote:

No parentheses for single line.

https://github.com/llvm/llvm-project/pull/166615


More information about the llvm-commits mailing list