mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-20 20:38:48 +00:00
flip the scev minus direction to simplify the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186466 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7c8a26030f
commit
71cc5e4ea2
@ -1004,7 +1004,7 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) {
|
|||||||
// Calculate the distance.
|
// Calculate the distance.
|
||||||
const SCEV *PtrSCEVA = SE->getSCEV(PtrA);
|
const SCEV *PtrSCEVA = SE->getSCEV(PtrA);
|
||||||
const SCEV *PtrSCEVB = SE->getSCEV(PtrB);
|
const SCEV *PtrSCEVB = SE->getSCEV(PtrB);
|
||||||
const SCEV *OffsetSCEV = SE->getMinusSCEV(PtrSCEVA, PtrSCEVB);
|
const SCEV *OffsetSCEV = SE->getMinusSCEV(PtrSCEVB, PtrSCEVA);
|
||||||
const SCEVConstant *ConstOffSCEV = dyn_cast<SCEVConstant>(OffsetSCEV);
|
const SCEVConstant *ConstOffSCEV = dyn_cast<SCEVConstant>(OffsetSCEV);
|
||||||
|
|
||||||
// Non constant distance.
|
// Non constant distance.
|
||||||
@ -1013,10 +1013,10 @@ bool BoUpSLP::isConsecutiveAccess(Value *A, Value *B) {
|
|||||||
|
|
||||||
int64_t Offset = ConstOffSCEV->getValue()->getSExtValue();
|
int64_t Offset = ConstOffSCEV->getValue()->getSExtValue();
|
||||||
Type *Ty = cast<PointerType>(PtrA->getType())->getElementType();
|
Type *Ty = cast<PointerType>(PtrA->getType())->getElementType();
|
||||||
// The Instructions are connsecutive if the size of the first load/store is
|
// The Instructions are consecutive if the size of the first load/store is
|
||||||
// the same as the offset.
|
// the same as the offset.
|
||||||
int64_t Sz = DL->getTypeStoreSize(Ty);
|
int64_t Sz = DL->getTypeStoreSize(Ty);
|
||||||
return ((-Offset) == Sz);
|
return (Offset == Sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
Value *BoUpSLP::getSinkBarrier(Instruction *Src, Instruction *Dst) {
|
Value *BoUpSLP::getSinkBarrier(Instruction *Src, Instruction *Dst) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user