This is an archive of the discontinued LLVM Phabricator instance.

[X86][CodeGen] Add a dag pattern to fix #64323
ClosedPublic

Authored by Peter on Aug 19 2023, 9:09 PM.

Details

Summary

After recent patch D30189, #64323's error message become a new one.
When DAGCombiner was optimizing (vextract (scalar_to_vector val, 0) -> val, it didn't
consider the possibility that the inserted value type has less bit than the dest type.
This patch fixes that.

Diff Detail

Event Timeline

Peter created this revision.Aug 19 2023, 9:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2023, 9:09 PM
Peter requested review of this revision.Aug 19 2023, 9:09 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 19 2023, 9:09 PM
pengfei added inline comments.Aug 21 2023, 12:14 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
21707–21710

The comments need update.

21716

Do not use else when the previous condition ends with return.

21718

ditto.

RKSimon added inline comments.Aug 21 2023, 4:21 AM
llvm/test/CodeGen/X86/pr64323.ll
6

nounwind to reduce cfi noise

goldstein.w.n added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
21716

you can also just remove second if entirely.

Peter updated this revision to Diff 552430.Aug 22 2023, 10:46 AM

Update comment per request.

Peter marked 4 inline comments as done.Aug 22 2023, 10:50 AM
Peter updated this revision to Diff 552434.Aug 22 2023, 10:52 AM

nounwind for testcases to reduce noise.

Peter marked an inline comment as done.Aug 22 2023, 10:52 AM
pengfei accepted this revision.Aug 22 2023, 10:46 PM

LGTM.

This revision is now accepted and ready to land.Aug 22 2023, 10:46 PM
This revision was landed with ongoing or failed builds.Aug 23 2023, 10:50 AM
This revision was automatically updated to reflect the committed changes.