mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-26 07:34:14 +00:00
do some computation with apints instead of ConstantInts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59401 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ea065fbdd8
commit
aa3e157845
@ -3590,16 +3590,15 @@ Instruction *InstCombiner::FoldAndOfICmps(Instruction &I,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Ensure that the larger constant is on the RHS.
|
// Ensure that the larger constant is on the RHS.
|
||||||
ICmpInst::Predicate GT;
|
bool ShouldSwap;
|
||||||
if (ICmpInst::isSignedPredicate(LHSCC) ||
|
if (ICmpInst::isSignedPredicate(LHSCC) ||
|
||||||
(ICmpInst::isEquality(LHSCC) &&
|
(ICmpInst::isEquality(LHSCC) &&
|
||||||
ICmpInst::isSignedPredicate(RHSCC)))
|
ICmpInst::isSignedPredicate(RHSCC)))
|
||||||
GT = ICmpInst::ICMP_SGT;
|
ShouldSwap = LHSCst->getValue().sgt(RHSCst->getValue());
|
||||||
else
|
else
|
||||||
GT = ICmpInst::ICMP_UGT;
|
ShouldSwap = LHSCst->getValue().ugt(RHSCst->getValue());
|
||||||
|
|
||||||
Constant *Cmp = ConstantExpr::getICmp(GT, LHSCst, RHSCst);
|
if (ShouldSwap) {
|
||||||
if (cast<ConstantInt>(Cmp)->getZExtValue()) {
|
|
||||||
std::swap(LHS, RHS);
|
std::swap(LHS, RHS);
|
||||||
std::swap(LHSCst, RHSCst);
|
std::swap(LHSCst, RHSCst);
|
||||||
std::swap(LHSCC, RHSCC);
|
std::swap(LHSCC, RHSCC);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user