Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectorizer bug fix: address argument of memory operations #3446

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions backend/cfg/vectorize.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2873,7 +2873,9 @@ let augment_reg_map reg_map group =
let add_vector_instructions_for_group reg_map state group ~before:cell
old_instruction =
let vector_instructions = Computation.Group.vector_instructions group in
let key_instruction = Instruction.basic old_instruction in
let first_instruction =
Computation.Group.scalar_instructions group |> List.hd
in
let new_regs : Reg.t Numbers.Int.Tbl.t = Numbers.Int.Tbl.create 2 in
let get_new_reg n =
match Numbers.Int.Tbl.find_opt new_regs n with
Expand All @@ -2890,13 +2892,13 @@ let add_vector_instructions_for_group reg_map state group ~before:cell
match simd_reg with
| New n -> get_new_reg n
| Argument n ->
let original_reg = (Instruction.arguments key_instruction).(n) in
let original_reg = (Instruction.arguments first_instruction).(n) in
Substitution.get_reg_exn reg_map original_reg
| Result n ->
let original_reg = (Instruction.results key_instruction).(n) in
let original_reg = (Instruction.results first_instruction).(n) in
Substitution.get_reg_exn reg_map original_reg
| Original n ->
let original_reg = (Instruction.arguments key_instruction).(n) in
let original_reg = (Instruction.arguments first_instruction).(n) in
original_reg
in
let desc = Cfg.Op simd_instruction.operation in
Expand Down
Loading