[PATCH] D28813: [CodeGenPrepare] Sink and duplicate more 'and' instructions.
Geoff Berry via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 10:14:51 PST 2017
gberry created this revision.
Herald added a subscriber: aemerson.
Rework the code that was sinking/duplicating (icmp and, 0) sequences
into blocks where they were being used by conditional branches to form
more tbz instructions on AArch64. The new code is more general in that
it just looks for 'and's that have all icmp 0's as users, with a target
hook used to select which subset of 'and' instructions to consider.
This change also enables 'and' sinking for X86, where it is more widely
beneficial than on AArch64.
The 'and' sinking/duplicating code is moved into the optimizeInst phase
of CodeGenPrepare, where it can take advantage of the fact the
OptimizeCmpExpression has already sunk/duplicated any icmps into the
blocks where they are used. One minor complication from this change is
that optimizeLoadExt needed to be updated to always mark 'and's it has
determined should be in the same block as their feeding load in the
InsertedInsts set to avoid an infinite loop of hoisting and sinking the
This change fixes a regression on X86 in the tsan runtime caused by
moving GVNHoist to a later place in the optimization pipeline (see
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 19096 bytes
Desc: not available
More information about the llvm-commits