This is an archive of the discontinued LLVM Phabricator instance.

[MachineCSE] Don't carry the wrong location when hoisting
ClosedPublic

Authored by davide on Apr 6 2020, 4:08 PM.

Diff Detail

Event Timeline

davide created this revision.Apr 6 2020, 4:08 PM

Thanks to Jeremy for helping with the analysis!

davide updated this revision to Diff 255532.Apr 6 2020, 4:14 PM

Cleaned up testcase. Apparently TBAA is needed.

vsk accepted this revision.Apr 6 2020, 4:25 PM

Lgtm, thanks!

This revision is now accepted and ready to land.Apr 6 2020, 4:25 PM
davide closed this revision.Apr 6 2020, 4:36 PM

commit 8115e08b0536ab102311fd3ac399a52e97955ca2 (HEAD -> master, origin/master, origin/HEAD)
Author: Davide Italiano <ditaliano@apple.com>
Date: Mon Apr 6 16:35:30 2020 -0700

[MachineCSE] Don't carry the wrong location when hoisting

PR: 45425
<rdar://problem/61359768>

Differential Revision:  https://reviews.llvm.org/D77604
aprantl added inline comments.Apr 6 2020, 5:34 PM
llvm/lib/CodeGen/MachineCSE.cpp
839

Can NewMI be a call?
If yes, this should be an artificial location instead, or later inlining of the call will cause an IR verifier failure because the inline location is dropped.

davide marked an inline comment as done.Apr 6 2020, 6:03 PM
davide added inline comments.
llvm/lib/CodeGen/MachineCSE.cpp
839

I am probably missing the obvious, but this is already MIR. I don't think llvm does any inlining that late in the pipeline.

aprantl added inline comments.Apr 6 2020, 6:54 PM
llvm/lib/CodeGen/MachineCSE.cpp
839

I completely missed the fact that this is MIR. Sorry.