From e063e1f68a43354795a626b6546c50ade038437e Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Fri, 26 Aug 2016 22:32:55 +0000 Subject: [PATCH] [SelectionDAG] Do not run the ISel process on already selected code. Right now, this cannot happen, but with the fall back path of GlobalISel it will show up eventually. llvm-svn: 279877 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index e886d67..b9c4eb3 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -426,6 +426,10 @@ static void SplitCriticalSideEffectEdges(Function &Fn) { } bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { + // If we already selected that function, we do not need to run SDISel. + if (mf.getProperties().hasProperty( + MachineFunctionProperties::Property::Selected)) + return false; // Do some sanity-checking on the command-line options. assert((!EnableFastISelVerbose || TM.Options.EnableFastISel) && "-fast-isel-verbose requires -fast-isel"); -- 2.7.4