Commit 811891fd authored by Andrzej Ratajewski's avatar Andrzej Ratajewski

Instruction combining is not able to combine circular phi-select

instructions leading to the same instruction.
Example:
Entry:
   %0 = load <4 x float>
While.body:
   %1 = phi <4 x float> [ %0, %entry ], [ %2, %while.end ]
   ...
   %2 = select i1 %switch_cond, <4 x float> %0, <4 x float> %1

Change-Id: I463d49a2dfae3a836e2c98d48b23096d3b3022c5
parent 9a298959
......@@ -1329,7 +1329,10 @@ void OptimizeIR(CodeGenContext* pContext)
// Use CFGSimplification to do clean-up. Needs to be invoked before lowerSwitch.
mpm.add(llvm::createCFGSimplificationPass());
if(IGC_IS_FLAG_DISABLED(DisableFlattenSmallSwitch))
// run instruction combining to clean up the code after CFG optimizations
mpm.add(createIGCInstructionCombiningPass());
if (IGC_IS_FLAG_DISABLED(DisableFlattenSmallSwitch))
{
mpm.add(createFlattenSmallSwitchPass());
}
......@@ -1338,9 +1341,6 @@ void OptimizeIR(CodeGenContext* pContext)
// After lowering 'switch', run jump threading to remove redundant jumps.
mpm.add(llvm::createJumpThreadingPass());
// run instruction combining to clean up the code after CFG optimizations
mpm.add(createIGCInstructionCombiningPass());
mpm.add(llvm::createDeadCodeEliminationPass());
mpm.add(llvm::createEarlyCSEPass());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment