This is an archive of the discontinued LLVM Phabricator instance.

Fixed a bug that edge weights are not assigned correctly when lowering switch statement.
ClosedPublic

Authored by congh on Aug 26 2015, 5:17 PM.

Details

Summary

This is a one-line-change patch that moves the update to UnhandledWeights to the correct position: it should be updated for all clusters instead of just range clusters.

Diff Detail

Repository
rL LLVM

Event Timeline

congh updated this revision to Diff 33281.Aug 26 2015, 5:17 PM
congh retitled this revision from to Fixed a bug that edge weights are not assigned correctly when lowering switch statement..
congh updated this object.
congh added reviewers: hans, davidxl.
congh added a subscriber: llvm-commits.
hans accepted this revision.Aug 26 2015, 5:26 PM
hans edited edge metadata.
hans added a subscriber: test.

lgtm with some tweaks to the test.

test/CodeGen/X86/switch-edge-weight.ll
6 ↗(On Diff #33281)

Please add a CHECK-LABEL and move this into or after the @test function.

The alloca, store and load, etc. seem unnecessary. Can the test just switch on the function parameter?

This revision is now accepted and ready to land.Aug 26 2015, 5:26 PM
congh added inline comments.Aug 26 2015, 5:31 PM
test/CodeGen/X86/switch-edge-weight.ll
6 ↗(On Diff #33281)

Done. I have simplified the function as suggested by you (previously I just copies it from another test case but I should look for a simplest one).

Thank you!

congh updated this revision to Diff 33282.Aug 26 2015, 5:31 PM
congh edited edge metadata.

Updated the test case.

This revision was automatically updated to reflect the committed changes.