Skip to content

optimization bug: Wrong alignment in LLVM IR #35

@Zffu

Description

@Zffu

Wrong align on store and load operations, causing performance issue due to the align correction.

Example of Quickfall generated LLVM IR:

; ModuleID = 'quickfall_module'
source_filename = "quickfall_module"

declare i64 @test()

define i32 @main() {
entry:
  %test = call i64 @test()
  %function_ret_test = alloca i64, align 8
  store i64 %test, ptr %function_ret_test, align 4
  %v = alloca i64, align 8
  %function_ret_test1 = load i64, ptr %function_ret_test, align 4
  store i64 %function_ret_test1, ptr %v, align 4
  ret i32 0
}

Here we can see that the align 4 should actually be align 8

Metadata

Metadata

Assignees

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions