Skip to content

Commit c499c7b

Browse files
Add bound optimizations (#626)
* Add bound optimizations * Update Compiler.jl * add symlink for local build * actually fix * Update Compiler.jl * Update deps/build_local.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 272da5e commit c499c7b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

deps/build_local.jl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,22 @@ end
142142
lib_path = joinpath(source_dir, "bazel-bin", only(built_libs))
143143
isfile(lib_path) || error("Could not find library $lib_path in build directory")
144144

145+
if build_backend == "cuda"
146+
if !Base.Filesystem.ispath(joinpath(source_dir, "bazel-bin", "cuda", "bin", "ptxas"))
147+
Base.Filesystem.mkpath(joinpath(source_dir, "bazel-bin", "cuda", "bin"))
148+
Base.Filesystem.symlink(
149+
joinpath(
150+
source_dir,
151+
"bazel-bin",
152+
"libReactantExtra.so.runfiles",
153+
"cuda_nvcc",
154+
"bin",
155+
"ptxas",
156+
),
157+
joinpath(source_dir, "bazel-bin", "cuda", "bin", "ptxas"),
158+
)
159+
end
160+
end
145161
# Tell ReactantExtra_jll to load our library instead of the default artifact one
146162
set_preferences!(
147163
joinpath(dirname(@__DIR__), "LocalPreferences.toml"),

src/Compiler.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,11 @@ function optimization_passes(; no_nan::Bool=false, sroa::Bool=false)
317317
func_passes = join(["canonicalize", "cse", "canonicalize", transform_passes], ",")
318318
passes = ["inline{default-pipeline=canonicalize max-iterations=4}"]
319319
if sroa
320+
push!(passes, "propagate-constant-bounds")
320321
push!(passes, "sroa-wrappers")
321322
push!(passes, "libdevice-funcs-raise")
322323
push!(passes, "canonicalize")
324+
push!(passes, "remove-duplicate-func-def")
323325
end
324326
push!(passes, func_passes)
325327
return join(passes, ',')

0 commit comments

Comments
 (0)