mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
Add a getUMinFromMismatchedTypes helper function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73883 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -553,6 +553,12 @@ namespace llvm {
|
|||||||
SCEVHandle getUMaxFromMismatchedTypes(const SCEVHandle &LHS,
|
SCEVHandle getUMaxFromMismatchedTypes(const SCEVHandle &LHS,
|
||||||
const SCEVHandle &RHS);
|
const SCEVHandle &RHS);
|
||||||
|
|
||||||
|
/// getUMinFromMismatchedTypes - Promote the operands to the wider of
|
||||||
|
/// the types using zero-extension, and then perform a umin operation
|
||||||
|
/// with them.
|
||||||
|
SCEVHandle getUMinFromMismatchedTypes(const SCEVHandle &LHS,
|
||||||
|
const SCEVHandle &RHS);
|
||||||
|
|
||||||
/// hasSCEV - Return true if the SCEV for this value has already been
|
/// hasSCEV - Return true if the SCEV for this value has already been
|
||||||
/// computed.
|
/// computed.
|
||||||
bool hasSCEV(Value *V) const;
|
bool hasSCEV(Value *V) const;
|
||||||
|
@ -2156,6 +2156,22 @@ SCEVHandle ScalarEvolution::getUMaxFromMismatchedTypes(const SCEVHandle &LHS,
|
|||||||
return getUMaxExpr(PromotedLHS, PromotedRHS);
|
return getUMaxExpr(PromotedLHS, PromotedRHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// getUMinFromMismatchedTypes - Promote the operands to the wider of
|
||||||
|
/// the types using zero-extension, and then perform a umin operation
|
||||||
|
/// with them.
|
||||||
|
SCEVHandle ScalarEvolution::getUMinFromMismatchedTypes(const SCEVHandle &LHS,
|
||||||
|
const SCEVHandle &RHS) {
|
||||||
|
SCEVHandle PromotedLHS = LHS;
|
||||||
|
SCEVHandle PromotedRHS = RHS;
|
||||||
|
|
||||||
|
if (getTypeSizeInBits(LHS->getType()) > getTypeSizeInBits(RHS->getType()))
|
||||||
|
PromotedRHS = getZeroExtendExpr(RHS, LHS->getType());
|
||||||
|
else
|
||||||
|
PromotedLHS = getNoopOrZeroExtend(LHS, RHS->getType());
|
||||||
|
|
||||||
|
return getUMinExpr(PromotedLHS, PromotedRHS);
|
||||||
|
}
|
||||||
|
|
||||||
/// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value for
|
/// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value for
|
||||||
/// the specified instruction and replaces any references to the symbolic value
|
/// the specified instruction and replaces any references to the symbolic value
|
||||||
/// SymName with the specified value. This is used during PHI resolution.
|
/// SymName with the specified value. This is used during PHI resolution.
|
||||||
|
Reference in New Issue
Block a user