1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-26 14:33:02 +02:00
llvm-mirror/test/Transforms/CodeGenPrepare
Sanjay Patel 659d8f6866 [CGP] transform select instructions into branches and sink expensive operands
This was originally checked in at r250527, but reverted at r250570 because of PR25222.
There were at least 2 problems: 
1. The cost check was checking for an instruction with an exact cost of TCC_Expensive;
that should have been >=.
2. The cause of the clang stage 1 failures was illegally sinking 'call' instructions;
we can't sink instructions that may have side effects / are not safe to execute speculatively.

Fixed those conditions in sinkSelectOperand() and added test cases.

Original commit message:
This is a follow-up to the discussion in D12882.

Ideally, we would like SimplifyCFG to be able to form select instructions even when the operands
are expensive (as defined by the TTI cost model) because that may expose further optimizations.
However, we would then like a later pass like CodeGenPrepare to undo that transformation if the
target would likely benefit from not speculatively executing an expensive op (this patch).

Once we have this safety mechanism in place, we can adjust SimplifyCFG to restore its
select-formation behavior that changed with r248439.

Differential Revision: http://reviews.llvm.org/D13297

llvm-svn: 250743
2015-10-19 21:59:12 +00:00
..
AArch64
AMDGPU AMDGPU: Fix some places missed in rename 2015-06-19 17:39:03 +00:00
X86 [CGP] transform select instructions into branches and sink expensive operands 2015-10-19 21:59:12 +00:00
2008-11-24-RAUW-Self.ll
basic.ll
invariant.group.ll Introducing llvm.invariant.group.barrier intrinsic 2015-09-15 18:32:14 +00:00
overflow-intrinsics.ll [InstCombine][CodeGenPrep] Create llvm.uadd.with.overflow in CGP. 2015-04-10 21:07:09 +00:00
statepoint-relocate.ll [Statepoints] Support for "patchable" statepoints. 2015-05-12 23:52:24 +00:00