[PATCH] D56990: Bugfix for Replacement of tied operand of inline asm

Xiang Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 22:10:59 PST 2019


xiangzhangllvm added a comment.

!!! Hi, dear efriedma, very sorry! I just saw your reply.
line 2093: getTargetHooks().adjustInlineAsmType(... InputConstraint,...)  will just deal with the constrain string,  and it can't check the TiedOperand in the function.
So, this will make inconsistent adjust for the operand and its tied operand.
The error will not be found in the IR files, it will cause back end error. like:
"error in backend: Unsupported asm: input constraint with a matching output constraint of incompatible type!"

Please refer the adjustInlineAsmType() function, it will call the following function

  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)->getBitWidth() != 64) {
        // Invalid MMX constraint
        return nullptr;
      }
      return llvm::Type::getX86_MMXTy(CGF.getLLVMContext());
    }
    // No operation needed
    return Ty;
  }




Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56990/new/

https://reviews.llvm.org/D56990





More information about the cfe-commits mailing list