@@ -1084,8 +1084,9 @@ SDValue SelectionDAGBuilder::getControlRoot() {
1084
1084
1085
1085
void SelectionDAGBuilder::visit (const Instruction &I) {
1086
1086
// Set up outgoing PHI node register values before emitting the terminator.
1087
- if (I.isTerminator ())
1088
- HandlePHINodesInSuccessorBlocks (I.getParent (), true );
1087
+ if (I.isTerminator ()) {
1088
+ HandlePHINodesInSuccessorBlocks (I.getParent ());
1089
+ }
1089
1090
1090
1091
// Increase the SDNodeOrder if dealing with a non-debug instruction.
1091
1092
if (!isa<DbgInfoIntrinsic>(I))
@@ -2838,9 +2839,6 @@ void SelectionDAGBuilder::visitCallBr(const CallBrInst &I) {
2838
2839
visitInlineAsm (I);
2839
2840
CopyToExportRegsIfNeeded (&I);
2840
2841
2841
- // Set up outgoing PHI node register values before emitting the branch.
2842
- HandlePHINodesInSuccessorBlocks (I.getParent (), false );
2843
-
2844
2842
// Retrieve successors.
2845
2843
MachineBasicBlock *Return = FuncInfo.MBBMap [I.getDefaultDest ()];
2846
2844
@@ -9992,32 +9990,17 @@ void SelectionDAGISel::LowerArguments(const Function &F) {
9992
9990
// / directly add them, because expansion might result in multiple MBB's for one
9993
9991
// / BB. As such, the start of the BB might correspond to a different MBB than
9994
9992
// / the end.
9995
- void SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks (
9996
- const BasicBlock *LLVMBB, bool Preprocess ) {
9993
+ void
9994
+ SelectionDAGBuilder::HandlePHINodesInSuccessorBlocks ( const BasicBlock *LLVMBB) {
9997
9995
const Instruction *TI = LLVMBB->getTerminator ();
9998
- const CallBrInst *CI = dyn_cast<CallBrInst>(TI);
9996
+
9999
9997
SmallPtrSet<MachineBasicBlock *, 4 > SuccsHandled;
10000
9998
10001
9999
// Check PHI nodes in successors that expect a value to be available from this
10002
10000
// block.
10003
10001
for (unsigned succ = 0 , e = TI->getNumSuccessors (); succ != e; ++succ) {
10004
10002
const BasicBlock *SuccBB = TI->getSuccessor (succ);
10005
10003
if (!isa<PHINode>(SuccBB->begin ())) continue ;
10006
-
10007
- if (CI) {
10008
- if (Preprocess) {
10009
- // Don't push PHI node values back before an INLINEASM_BR instruction on
10010
- // the default branch.
10011
- if (SuccBB == CI->getDefaultDest ())
10012
- continue ;
10013
- } else {
10014
- // Don't push PHI node values back after an INLINEASM_BR instruction on
10015
- // the indirect branch.
10016
- if (SuccBB != CI->getDefaultDest ())
10017
- continue ;
10018
- }
10019
- }
10020
-
10021
10004
MachineBasicBlock *SuccMBB = FuncInfo.MBBMap [SuccBB];
10022
10005
10023
10006
// If this terminator has multiple identical successors (common for
0 commit comments