This is an archive of the discontinued LLVM Phabricator instance.

use "unpredictable" metadata in SelectionDAG when splitting compares
ClosedPublic

Authored by spatel on Aug 25 2015, 3:57 PM.

Details

Summary

This patch uses the metadata created by the llvm.unpredictable intrinsic in D12341 to avoid creating an unpredictable branch.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 33145.Aug 25 2015, 3:57 PM
spatel retitled this revision from to use "unpredictable" metadata in SelectionDAG when splitting compares.
spatel updated this object.
spatel added reviewers: hfinkel, chandlerc, kparzysz.
spatel added a subscriber: llvm-commits.
arsenm added a subscriber: arsenm.Aug 25 2015, 4:00 PM
arsenm added inline comments.
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
1601–1602 ↗(On Diff #33145)

bikeshed: Check the isJumpExpensive first

arsenm added inline comments.Aug 25 2015, 4:10 PM
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
1601–1602 ↗(On Diff #33145)

and after the hasOneUse. The metadata is the weirdest case reason to not this, so it makes sense to be the last thing checked

spatel updated this revision to Diff 33209.Aug 26 2015, 9:05 AM

Patch updated:

  1. Reordered branch conditions
  2. Added a temp variable for the opcode, so we don't repeat getOpcode() three times
spatel marked 2 inline comments as done.Aug 26 2015, 9:07 AM

Thanks, Matt - reordered predicates.

spatel updated this revision to Diff 33469.Aug 28 2015, 2:26 PM

Patch updated:
Added 'TODO' comment assuming that 'unpredictable' now carries a value rather being a boolean.

spatel updated this revision to Diff 33826.Sep 2 2015, 10:47 AM

Patch updated:
Removed comment about threshold value; we can add that feature when we have profile data to feed into this metadata.

This revision was automatically updated to reflect the committed changes.