This is an archive of the discontinued LLVM Phabricator instance.

[flang][codegen] Keep primitive type for extractvalue and insertvalue
ClosedPublic

Authored by clementval on Feb 8 2022, 8:27 AM.

Details

Summary

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'

Diff Detail

Event Timeline

clementval created this revision.Feb 8 2022, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2022, 8:27 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Feb 8 2022, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 8 2022, 8:27 AM
This revision is now accepted and ready to land.Feb 8 2022, 8:56 AM
schweitz accepted this revision.Feb 8 2022, 10:20 AM
This revision was landed with ongoing or failed builds.Feb 8 2022, 12:26 PM
This revision was automatically updated to reflect the committed changes.