This is an archive of the discontinued LLVM Phabricator instance.

[AArch64][SVE] Fix crash for DestructiveBinaryComm zero merging
ClosedPublic

Authored by Allen on Jan 11 2023, 2:12 AM.

Details

Summary

This fix is similar to D124325, and I find the DestructiveBinaryComm
operation type also may be allocated same register, so insert the LSL.

movprfx       z0.s, p0/z, z0.s
lsl z0.b, p0/m, z0.b, #0
fmul z0.s, p0/m, z0.s, z0.s

Diff Detail

Event Timeline

Allen created this revision.Jan 11 2023, 2:12 AM
Allen requested review of this revision.Jan 11 2023, 2:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2023, 2:12 AM
Matt added a subscriber: Matt.Jan 11 2023, 3:42 PM
paulwalker-arm accepted this revision.Jan 17 2023, 3:30 AM

This is what I was referring to during my review of D124325 whereby I was suggesting your fix was more generic than you thought and could be the way to solve all such problems for all the destructive types that have two or more operands.

That being said, I have no problem with build it up one destructive type at a time.

llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
561

This being an || chain already in brackets I doubt you need these inner brackets.

This revision is now accepted and ready to land.Jan 17 2023, 3:30 AM
Allen added a comment.Jan 17 2023, 4:14 AM

This is what I was referring to during my review of D124325 whereby I was suggesting your fix was more generic than you thought and could be the way to solve all such problems for all the destructive types that have two or more operands.

That being said, I have no problem with build it up one destructive type at a time.

Thanks, I'll follow up to deal with other destructive types in the next step.

Allen updated this revision to Diff 489768.Jan 17 2023, 4:34 AM
Allen marked an inline comment as done.

Add inner brackets according comment

This revision was landed with ongoing or failed builds.Jan 17 2023, 4:46 AM
This revision was automatically updated to reflect the committed changes.
paulwalker-arm added inline comments.Jan 17 2023, 4:48 AM
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
561

I think you've misunderstood my comment and have also introduced a bug. I meant there's no need for any new brackets i.e. you can write (DOPRegIsUnique || AArch64::DestructiveBinary == DType || AArch64::DestructiveBinaryComm == DType) && ...

Also with the new update you've incorrectly replaced the DestructiveBinaryComm comparison within an assignment of DType.

paulwalker-arm added inline comments.Jan 17 2023, 5:25 AM
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
561

I've pushed a fix.

Allen marked 2 inline comments as done.Jan 17 2023, 4:56 PM
Allen added inline comments.
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
561

Apply your comment, thanks

561

Oh, sorry. Thanks very much

Allen marked an inline comment as done.Jan 17 2023, 8:47 PM
Allen added inline comments.
llvm/lib/Target/AArch64/AArch64ExpandPseudoInsts.cpp
561

Oh, sorry. Thanks very much

561

Oh, sorry. Thanks very much

561

I see your commit 78ba3e785cd