mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-14 01:40:53 +00:00
Move the selection of the arms of the select operation up to the conditional
part to make sure we get the side effects and to avoid confusing the CFG. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
380ae49599
commit
3071019026
@ -1365,6 +1365,9 @@ unsigned ISel::SelectExpr(SDOperand N) {
|
||||
case ISD::SELECT: {
|
||||
Opc = SelectSetCR0(N.getOperand(0));
|
||||
|
||||
unsigned TrueValue = SelectExpr(N.getOperand(1)); //Use if TRUE
|
||||
unsigned FalseValue = SelectExpr(N.getOperand(2)); //Use if FALSE
|
||||
|
||||
// Create an iterator with which to insert the MBB for copying the false
|
||||
// value and the MBB to hold the PHI instruction for this SetCC.
|
||||
MachineBasicBlock *thisMBB = BB;
|
||||
@ -1380,7 +1383,6 @@ unsigned ISel::SelectExpr(SDOperand N) {
|
||||
// fallthrough --> copy0MBB
|
||||
MachineBasicBlock *copy0MBB = new MachineBasicBlock(LLVM_BB);
|
||||
MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
|
||||
unsigned TrueValue = SelectExpr(N.getOperand(1)); //Use if TRUE
|
||||
BuildMI(BB, Opc, 2).addReg(PPC::CR0).addMBB(sinkMBB);
|
||||
MachineFunction *F = BB->getParent();
|
||||
F->getBasicBlockList().insert(It, copy0MBB);
|
||||
@ -1393,7 +1395,6 @@ unsigned ISel::SelectExpr(SDOperand N) {
|
||||
// %FalseValue = ...
|
||||
// # fallthrough to sinkMBB
|
||||
BB = copy0MBB;
|
||||
unsigned FalseValue = SelectExpr(N.getOperand(2)); //Use if FALSE
|
||||
// Update machine-CFG edges
|
||||
BB->addSuccessor(sinkMBB);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user