This is an archive of the discontinued LLVM Phabricator instance.

[GVN] Pre-commit test case showing miscompile in github issue #57025
ClosedPublic

Authored by bjope on Aug 12 2022, 7:02 AM.

Details

Summary

This commit adds a reproducer for

https://github.com/llvm/llvm-project/issues/57025

showing a miscompile in GVN.

Not sure how likely this kind of faults would be in a normal pipeline,
considering that the input IR has some dead code in it. On the other
hand, GVN itself sometimes creates dead basic blocks when splitting
critical edges. Anyway, the fault was found when doing fuzzy testing
using random pass pipelines.

Diff Detail

Event Timeline

bjope created this revision.Aug 12 2022, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 7:02 AM
bjope requested review of this revision.Aug 12 2022, 7:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2022, 7:02 AM
fhahn added inline comments.Aug 30 2022, 3:14 AM
llvm/test/Transforms/GVN/memdep-unknown-deadblocks.ll
30

Could you also add a FIXME: saying what load/store gets mis-optimized by GVN currently?

bjope updated this revision to Diff 456903.Aug 31 2022, 2:18 AM

Adding a FIXME to the test case.

Worth mentioning is that there is a patch up for review, to fix the problem, here: https://reviews.llvm.org/D132935

nikic accepted this revision.Aug 31 2022, 2:35 PM

LG. The O1 runs are a bit unusual, but are helpful to make the miscompile more obvious...

This revision is now accepted and ready to land.Aug 31 2022, 2:35 PM
fhahn accepted this revision.Sep 1 2022, 12:15 AM

LGTM, thanks for the detailed explanation in the test case!

This revision was landed with ongoing or failed builds.Sep 1 2022, 5:44 AM
This revision was automatically updated to reflect the committed changes.