mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
This removes TODO added in http://reviews.llvm.org/D3658
The patch transforms ABS(NABS(X)) -> ABS(X) NABS(ABS(X)) -> NABS(X) Differential Revision: http://reviews.llvm.org/D4040 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210782 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -733,8 +733,15 @@ Instruction *InstCombiner::FoldSPFofSPF(Instruction *Inner,
|
||||
return ReplaceInstUsesWith(Outer, Inner);
|
||||
}
|
||||
|
||||
// TODO: ABS(NABS(X)) -> ABS(X)
|
||||
// TODO: NABS(ABS(X)) -> NABS(X)
|
||||
// ABS(NABS(X)) -> ABS(X)
|
||||
// NABS(ABS(X)) -> NABS(X)
|
||||
if ((SPF1 == SPF_ABS && SPF2 == SPF_NABS) ||
|
||||
(SPF1 == SPF_NABS && SPF2 == SPF_ABS)) {
|
||||
SelectInst *SI = cast<SelectInst>(Inner);
|
||||
Value *NewSI = Builder->CreateSelect(
|
||||
SI->getCondition(), SI->getFalseValue(), SI->getTrueValue());
|
||||
return ReplaceInstUsesWith(Outer, NewSI);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user