[PATCH] D124514: [ArgPromotion] Make a non-byval promotion attempt first

Pavel Samolysov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 4 08:25:25 PDT 2022


psamolysov added a comment.

And I see that the "usual" (non-byval) promotion uses `i64` for the second argument of the generated `GEP` instructions:

    %2 = alloca %struct.A, align 32
    %3 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 0
    store float %0, float* %3, align 32
    %4 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 2
    store i64 2, i64* %4, align 16
  
  ; the struct is ready, use GEP and load to prepare new values for the arguments
    %5 = getelementptr %struct.A, %struct.A* %2, i64 0, i32 0 ; i64 0, not i32 0
    %.val = load float, float* %5, align 32
    %6 = getelementptr %struct.A, %struct.A* %2, i64 0, i32 2 ; i64 0, not i32 0
    %.val1 = load i64, i64* %6, align 16

Does this work as designed?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124514/new/

https://reviews.llvm.org/D124514



More information about the llvm-commits mailing list