This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Implement undef combines for funnel shifts
Needs RevisionPublic

Authored by paquette on Oct 1 2022, 3:13 PM.

Details

Summary

AFAICT the way SDAG does this is:

fshl (x, y, undef) -> x for scalars
fshr (x, y, undef) -> y for scalars
fshl (x, y, undef) -> undef for vectors
fshr (x, y, undef) -> undef for vectors

https://gcc.godbolt.org/z/xq9PYfhYh

This should fix https://github.com/llvm/llvm-project/issues/57256

Diff Detail

Event Timeline

paquette created this revision.Oct 1 2022, 3:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2022, 3:13 PM
paquette requested review of this revision.Oct 1 2022, 3:13 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2022, 3:13 PM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added a comment.Oct 1 2022, 3:42 PM

Doesn't remove whatever was incorrectly folding this before

llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
763–764

Different behavior for vector and scalar sounds really broken

aemerson added inline comments.Oct 3 2022, 1:51 PM
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
763–764

Yeah this sounds very sus.

arsenm requested changes to this revision.Nov 16 2022, 3:28 PM

The different scalar and vector behavior is broken and should be fixed

This revision now requires changes to proceed.Nov 16 2022, 3:28 PM