[TensorExpr] Fix LLVM 12 build after LLVM API changes (#47480)
Summary:
PolySize was removed: https://reviews.llvm.org/D88982
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47480
Test Plan: Build against LLVM 12.
Reviewed By: glaringlee
Differential Revision: D24773973
Pulled By: asuhan
fbshipit-source-id: d09566675c043d8b63032c52bdadd09e09ccfc39
diff --git a/torch/csrc/jit/tensorexpr/llvm_codegen.cpp b/torch/csrc/jit/tensorexpr/llvm_codegen.cpp
index bafb559..a2a6d15 100644
--- a/torch/csrc/jit/tensorexpr/llvm_codegen.cpp
+++ b/torch/csrc/jit/tensorexpr/llvm_codegen.cpp
@@ -87,7 +87,7 @@
#if LLVM_VERSION_MAJOR <= 11
return llvm::ElementCount(static_cast<unsigned>(lanes), false);
#elif LLVM_VERSION_MAJOR == 12
- return llvm::ElementCount(llvm::PolySize<unsigned>::getFixed(lanes));
+ return llvm::ElementCount::getFixed(lanes);
#else
#error Only LLVM versions 8 through 12 are supported.
#endif