mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Revert r237539: "Reapply r237520 with another fix for infinite looping"
This caused PR23583. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237739 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -3970,19 +3970,6 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test if the FCmpInst instruction is used exclusively by a select as
|
||||
// part of a minimum or maximum operation. If so, refrain from doing
|
||||
// any other folding. This helps out other analyses which understand
|
||||
// non-obfuscated minimum and maximum idioms, such as ScalarEvolution
|
||||
// and CodeGen. And in this case, at least one of the comparison
|
||||
// operands has at least one user besides the compare (the select),
|
||||
// which would often largely negate the benefit of folding anyway.
|
||||
if (I.hasOneUse())
|
||||
if (SelectInst *SI = dyn_cast<SelectInst>(*I.user_begin()))
|
||||
if ((SI->getOperand(1) == Op0 && SI->getOperand(2) == Op1) ||
|
||||
(SI->getOperand(2) == Op0 && SI->getOperand(1) == Op1))
|
||||
return nullptr;
|
||||
|
||||
// Handle fcmp with constant RHS
|
||||
if (Constant *RHSC = dyn_cast<Constant>(Op1)) {
|
||||
if (Instruction *LHSI = dyn_cast<Instruction>(Op0))
|
||||
|
||||
Reference in New Issue
Block a user