llvm / llvm/llvm-project

[GlobalISel] Require explicit G_BITCAST for same-size scalar G_MERGE_VALUES type changes

Open
#209,290 0 comments 0 reactions 1 assignee Claimed by @michalpaszkowski View on GitHub
llvm:globalisel
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Generic MIR currently allows G_MERGE_VALUES to reassemble into a same-size scalar of a different type flavor, for example rebuilding f32 from pieces unmerged from i32. This is relied on in lowering and forced a workaround in LegalizationArtifactCombiner.h to emit G_BITCAST during artifact combining.

Tighten this so same-size scalar type changes require an explicit G_BITCAST instead of being represented directly by G_MERGE_VALUES. That should let us remove the current combiner patch.

Please see for more details: https://github.com/llvm/llvm-project/pull/200946

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.