[all-commits] [llvm/llvm-project] 9b5bb5: [flang][codegen] Keep primitive type for extractva...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Tue Feb 8 12:26:53 PST 2022

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9b5bb511adac5fc624dcaa8e25d0a09ad23577c3
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2022-02-08 (Tue, 08 Feb 2022)

  Changed paths:
    M flang/lib/Optimizer/CodeGen/TargetRewrite.cpp
    M flang/test/Fir/target-rewrite-complex.fir

  Log Message:
  [flang][codegen] Keep primitive type for extractvalue and insertvalue

llvm.insertvalue and llvm.extractvalue need LLVM primitive type
for the indexing operands. While upstreaming the TargetRewrite pass the change
was made from i32 to index without knowing this restriction. This patch reverts
back the types used for indexing in the two ops created in this pass.

the error you will receive when lowering to LLVM IR with the current code
is the following:

 'llvm.insertvalue' op operand #1 must be primitive LLVM type, but got 'index'

Reviewed By: jeanPerier, schweitz

Differential Revision: https://reviews.llvm.org/D119253

More information about the All-commits mailing list