[FRONTEND] Fixed inliner and got more tests to pass (#822)

This adds a `DialectInlinerInterface` to the Triton dialect. This, along
with a few other minor semantic changes, fixes our tests on call
instructions. Also added the option to provide use an "LLVM_SYSPATH"
environment variable to link against locally build of LLVM; this was
useful for debugging this issue.
This commit is contained in:
Philippe Tillet
2022-10-30 14:10:02 -07:00
committed by GitHub
parent 71428194a1
commit e61dc75942
7 changed files with 192 additions and 155 deletions

View File

@@ -38,12 +38,13 @@ class Package(NamedTuple):
test_file: str
include_flag: str
lib_flag: str
syspath_var_name: str
def get_pybind11_package_info():
name = "pybind11-2.10.0"
url = "https://github.com/pybind/pybind11/archive/refs/tags/v2.10.0.tar.gz"
return Package("pybind11", name, url, "include/pybind11/pybind11.h", "PYBIND11_INCLUDE_DIR", "")
return Package("pybind11", name, url, "include/pybind11/pybind11.h", "PYBIND11_INCLUDE_DIR", "", "PYBIND11_SYSPATH")
def get_llvm_package_info():
@@ -57,7 +58,7 @@ def get_llvm_package_info():
else:
name = 'clang+llvm-14.0.0-x86_64-{}'.format(system_suffix)
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/{}.tar.xz".format(name)
return Package("llvm", name, url, "lib", "LLVM_INCLUDE_DIRS", "LLVM_LIBRARY_DIR")
return Package("llvm", name, url, "lib", "LLVM_INCLUDE_DIRS", "LLVM_LIBRARY_DIR", "LLVM_SYSPATH")
def get_thirdparty_packages(triton_cache_path):
@@ -67,6 +68,8 @@ def get_thirdparty_packages(triton_cache_path):
package_root_dir = os.path.join(triton_cache_path, p.package)
package_dir = os.path.join(package_root_dir, p.name)
test_file_path = os.path.join(package_dir, p.test_file)
if p.syspath_var_name in os.environ:
package_dir = os.environ[p.syspath_var_name]
if not os.path.exists(test_file_path):
try:
shutil.rmtree(package_root_dir)