mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 18:29:46 +00:00
For the return type of SCEVUDivExpr, use the RHS' type instead of
that of the LHS. It doesn't matter for correctness, but the LHS is more likely than the RHS to be a pointer type in exotic cases, and it's more tidy to have it return the integer type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72424 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d9480d0f68
commit
91bb61a1e2
@ -346,7 +346,12 @@ void SCEVUDivExpr::print(raw_ostream &OS) const {
|
||||
}
|
||||
|
||||
const Type *SCEVUDivExpr::getType() const {
|
||||
return LHS->getType();
|
||||
// In most cases the types of LHS and RHS will be the same, but in some
|
||||
// crazy cases one or the other may be a pointer. ScalarEvolution doesn't
|
||||
// depend on the type for correctness, but handling types carefully can
|
||||
// avoid extra casts in the SCEVExpander. The LHS is more likely to be
|
||||
// a pointer type than the RHS, so use the RHS' type here.
|
||||
return RHS->getType();
|
||||
}
|
||||
|
||||
// SCEVAddRecExprs - Only allow the creation of one SCEVAddRecExpr for any
|
||||
|
Loading…
Reference in New Issue
Block a user