Skip to content

Commit 611cf78

Browse files
ayermolodmenig
authored andcommitted
[llvm][oncall] Fix build for llvm-18+ (pytorch#115652)
Summary: https://reviews.llvm.org/D137838 moved Host.h and some other files under TargetParser. llvm/llvm-project#74261 Removed it from Support folder. Pull Request resolved: pytorch#115652 Approved by: https://github.com/davidberard98
1 parent e385d93 commit 611cf78

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

torch/csrc/jit/tensorexpr/llvm_codegen.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
#include <llvm/Passes/PassBuilder.h>
3636
#pragma GCC diagnostic pop
3737

38+
#if LLVM_VERSION_MAJOR >= 18
39+
#include <llvm/TargetParser/Host.h>
40+
#else
3841
#include <llvm/Support/Host.h>
42+
#endif
3943
#include <llvm/Support/TargetSelect.h>
4044
#include <llvm/Transforms/IPO/AlwaysInliner.h>
4145
#include <llvm/Transforms/Scalar/DCE.h>

torch/csrc/jit/tensorexpr/llvm_jit.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ C10_DIAGNOSTIC_POP()
2828
#include <llvm/IR/Mangler.h>
2929
#include <llvm/Support/CFGUpdate.h>
3030
#include <llvm/Support/DynamicLibrary.h>
31+
#if LLVM_VERSION_MAJOR >= 18
32+
#include <llvm/TargetParser/Host.h>
33+
#else
3134
#include <llvm/Support/Host.h>
35+
#endif
3236
#include <llvm/Support/raw_ostream.h>
3337
#include <llvm/Target/TargetMachine.h>
3438

0 commit comments

Comments
 (0)