Displaying 2 results from an estimated 2 matches for "optimizecondbranch".
2016 Mar 10
2
[CodeGen] PeepholeOptimizer: optimizing condition dependent instrunctions
...eck all instructions which use AArch64::NZCV whether they can be substituted with the simpler version. After all I delete CmpInstr. This approach contradicts with PeepholeOptimizer design because BRC and SEL must be processed in corresponding functions. Yes, 'analyzeCompare' is cheap but in optimizeCondBranch and in optimizeSelect we need to go up to find the instruction defining condition flags. In case of BRC CMP should not be far from it but I am not sure about SEL. Also when BRC is replaced with BR CMP can be removed (BTW processing of instructions below BRC can be stopped). I don't know if ther...
2016 Mar 09
2
[CodeGen] PeepholeOptimizer: optimizing condition dependent instrunctions
...pInstr(MI, &MBB)) ||
01580 (MI->isSelect() && optimizeSelect(MI, LocalMIs))) {
01581 // MI is deleted.
01582 LocalMIs.erase(MI);
01583 Changed = true;
01584 continue;
01585 }
01586
01587 if (MI->isConditionalBranch() && optimizeCondBranch(MI)) {
01588 Changed = true;
01589 continue;
01590 }
CmpInstr, SelectInstr and CondBranch are processed separately. It's assumed that CmpInstr and SelectInstr are deleted but CondBranch is not.
In fact CmpInstr is always connected to SelectInstr or CondBranch or both of t...