Skip to content

Commit

Permalink
Attach the datalayout before optimizing the LLVM module (#4761)
Browse files Browse the repository at this point in the history
We should always set the `datalayout` when we run the optimization
pipeline on the LLVM IR module.
  • Loading branch information
giuseros committed Sep 19, 2024
1 parent fad49b2 commit ad0cdfb
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions third_party/amd/backend/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def make_llir(src, metadata, options):
context = llvm.context()
llvm_mod = llvm.to_module(mod, context)
amd.attach_target_triple(llvm_mod)
llvm.attach_datalayout(llvm_mod, amd.TARGET_TRIPLE, options.arch, '')

# Set various control constants on the LLVM module so that device
# libraries can resolve references to them.
Expand Down

0 comments on commit ad0cdfb

Please sign in to comment.