Page MenuHomePhabricator

Ignore debug info when making optimization decisions in SimplifyCFG.
ClosedPublic

Authored by danielcdh on Oct 5 2016, 10:24 AM.

Details

Summary

Debug info should *not* affect code generation. This patch properly handles debug info to make sure the generated code are the same with or without debug info.

Event Timeline

danielcdh updated this revision to Diff 73670.Oct 5 2016, 10:24 AM
danielcdh retitled this revision from to Ignore debug info when making optimization decisions in SimplifyCFG..
danielcdh updated this object.
danielcdh added reviewers: davidxl, mzolotukhin.
danielcdh added a subscriber: llvm-commits.
jmolloy added inline comments.Oct 6 2016, 4:30 AM
lib/Transforms/Utils/SimplifyCFG.cpp
1493

You shouldn't have to check this here, because canSinkLastInstruction should have checked it.

Sidenote: I think you need to make sure it's checked in canSinkLastInstruction :)

danielcdh added inline comments.Oct 6 2016, 8:15 AM
lib/Transforms/Utils/SimplifyCFG.cpp
1493

But canSinkLastInstruction only skips the DbgInfoIntrinsic. If we don't have the logic here, I0 may end up being a DbgInfoIntrinsic?

aprantl added a subscriber: aprantl.Oct 7 2016, 3:29 PM
jmolloy accepted this revision.Oct 17 2016, 5:18 AM
jmolloy edited edge metadata.

Sorry this took so long. LGTM.

lib/Transforms/Utils/SimplifyCFG.cpp
1493

Ah yes, you're right.

This revision is now accepted and ready to land.Oct 17 2016, 5:18 AM
danielcdh updated this revision to Diff 74877.Oct 17 2016, 11:44 AM
danielcdh edited edge metadata.

rebase

danielcdh closed this revision.Oct 17 2016, 12:37 PM