Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 900e1da

Browse files
c0d1f1edben-clayton
authored andcommitted
Fix setting LLVM data layout before optimizations passes
The data layout was only being set right before lowering to machine code. The optimization passes need accurate data layout info as well. Bug: b/135691587 Change-Id: Ic1524d57bb6d8d0eb725e33d27e100a6286f1571 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/33309 Tested-by: Nicolas Capens <nicolascapens@google.com> Presubmit-Ready: Nicolas Capens <nicolascapens@google.com> Reviewed-by: Ben Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
1 parent c8f25d9 commit 900e1da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Reactor/LLVMReactor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,7 @@ namespace rr
678678
void startSession()
679679
{
680680
::module = new llvm::Module("", *::context);
681+
::module->setDataLayout(dataLayout);
681682
}
682683

683684
void endSession()
@@ -705,7 +706,6 @@ namespace rr
705706
// been freed.
706707
std::unique_ptr<llvm::Module> mod(::module);
707708
::module = nullptr;
708-
mod->setDataLayout(dataLayout);
709709

710710
auto moduleKey = session.allocateVModule();
711711

0 commit comments

Comments
 (0)