This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Fix crash in replaceStoreOfInsertLoad
ClosedPublic

Authored by Pierre-vh on Aug 3 2023, 1:53 AM.

Details

Summary

Idx's type can be different from Ptr's, causing a "Binary operator types must match" assertion failure when emitting the MUL.

Diff Detail

Unit TestsFailed

Event Timeline

Pierre-vh created this revision.Aug 3 2023, 1:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 1:53 AM
Pierre-vh requested review of this revision.Aug 3 2023, 1:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2023, 1:53 AM
arsenm added inline comments.Aug 3 2023, 4:01 PM
llvm/test/CodeGen/AMDGPU/replace-store-of-insert-load.ll
3

Don't need -verify-machineinstrs

3

should use a full triple since the alignment matters

16

Use named values

17

can you try a few different offsets and types?

Pierre-vh updated this revision to Diff 547111.Aug 4 2023, 12:04 AM
Pierre-vh marked 4 inline comments as done.

Update tests

arsenm accepted this revision.Aug 8 2023, 5:37 AM
arsenm added inline comments.
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
20526

Can drop the check, getZExtOrTrunc does it for you

This revision is now accepted and ready to land.Aug 8 2023, 5:37 AM
This revision was landed with ongoing or failed builds.Aug 8 2023, 6:15 AM
This revision was automatically updated to reflect the committed changes.
Pierre-vh marked an inline comment as done.