[TensorExpr] LLVMCodegen: Use addFnAttr instead of addAttribute which was deleted...
authorMikhail Zolotukhin <mvz@fb.com>
Wed, 25 Aug 2021 04:21:57 +0000 (21:21 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 25 Aug 2021 04:23:06 +0000 (21:23 -0700)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63886

cc gmagogsfm

Test Plan: Imported from OSS

Reviewed By: bertmaher

Differential Revision: D30523135

Pulled By: ZolotukhinM

fbshipit-source-id: 62e125f917b2a0153eb30879d93cf956587a05e0

torch/csrc/jit/tensorexpr/llvm_codegen.cpp

index 5346d3668ec7eefe345732ebfa65a072e0c6ba82..a93fd64df0a68a907e6be48bb2939b675d740495 100644 (file)
@@ -424,9 +424,7 @@ LLVMCodeGenImpl::LLVMCodeGenImpl(
   llvm::FunctionType* fntype = llvm::FunctionType::get(retTy, params, false);
   fn_ = llvm::Function::Create(
       fntype, llvm::Function::PrivateLinkage, "pytorch", module_.get());
-  fn_->addAttribute(
-      llvm::AttributeList::AttrIndex::FunctionIndex,
-      llvm::Attribute::AlwaysInline);
+  fn_->addFnAttr(llvm::Attribute::AlwaysInline);
   for (const auto i : c10::irange(args.size())) {
     if (!args[i].isVar()) {
       fn_->addParamAttr(i, llvm::Attribute::NoAlias);