This is an archive of the discontinued LLVM Phabricator instance.

[X86] Suppress load folding into and/or/xor if it will prevent matching btr/bts/btc.
ClosedPublic

Authored by craig.topper on Jun 27 2018, 11:52 PM.

Details

Summary

This is a follow up to r335753. At the time I forgot about isProfitableToFold which makes this pretty easy.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jun 27 2018, 11:52 PM

This looks reasonable, but i'm not familiar with that code.

lib/Target/X86/X86ISelDAGToDAG.cpp
576 ↗(On Diff #153261)

Extra unneeded brackets

xbolva00 added inline comments.
lib/Target/X86/X86ISelDAGToDAG.cpp
594 ↗(On Diff #153261)

dyn_cast maybe?

craig.topper added inline comments.Jun 28 2018, 12:33 AM
lib/Target/X86/X86ISelDAGToDAG.cpp
576 ↗(On Diff #153261)

Oops. Leftover from before I realized that I had to handle both operand orders.

594 ↗(On Diff #153261)

I was just trying to avoid another level of 'if'

RKSimon accepted this revision.Jun 28 2018, 7:59 AM

LGTM once the extra brackets have been fixed. I'm happy with either the isa/cast pattern or replacing with a dyn_cast inner if().

This revision is now accepted and ready to land.Jun 28 2018, 7:59 AM
This revision was automatically updated to reflect the committed changes.