llvmGen: Take advantage of expected values in conditional branches
AbandonedPublic

Authored by bgamari on Jun 17 2016, 6:43 AM.

Details

Reviewers
austin
Summary

Previously we lowered conditional branches to LLVM IR ignoring the
expected value provided by the C-- representation. This causes LLVM to emit
code with the wrong branch prediction properties.

Test Plan

Validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Branch
wip/llvm-branch-weights
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 10120
Build 12165: arc lint + arc unit
bgamari retitled this revision from to llvmGen: Take advantage of expected values in conditional branches.Jun 17 2016, 6:43 AM
bgamari updated this object.
bgamari edited the test plan for this revision. (Show Details)
bgamari updated this revision to Diff 7982.Jun 17 2016, 7:00 AM

Fix silly mistakes

Thanks for doing this! I love it when you write a TODO and someone else does it.

bgamari updated this revision to Diff 7987.Jun 17 2016, 10:19 AM

Another approach

This time using the branch_weights metadata attribute.

bgamari updated this revision to Diff 7988.Jun 17 2016, 1:48 PM
  • Fix it
austin accepted this revision.Jul 11 2016, 5:59 PM

LGTM

This revision is now accepted and ready to land.Jul 11 2016, 5:59 PM
bgamari abandoned this revision.Jul 20 2016, 2:52 AM
bgamari added a subscriber: ezyang.

@ezyang says,

oh, don't take that one yet

bgamari reclaimed this revision.Jul 20 2016, 2:52 AM
This revision is now accepted and ready to land.Jul 20 2016, 2:52 AM
bgamari planned changes to this revision.Jul 20 2016, 2:52 AM
bgamari added a comment.EditedJul 20 2016, 3:13 AM

Wow, ignore my antics; the above had nothing to do with this Diff.

That being said, I still am planning changes here since I see no sign of the intended branch_weights annotations in the LLVM output.

spacekitteh abandoned this revision.EditedApr 15 2017, 12:30 AM
spacekitteh added a subscriber: spacekitteh.

Replaced by D2688

spacekitteh added a subscriber: spacekitteh.