mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
Change a bunch of isVolatile() checks to check for atomic load/store as well.
No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic. I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly. I'm going to try and come up with some additional testing, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139533 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -267,7 +267,7 @@ bool LoopIdiomRecognize::runOnLoopBlock(BasicBlock *BB, const SCEV *BECount,
|
||||
|
||||
/// processLoopStore - See if this store can be promoted to a memset or memcpy.
|
||||
bool LoopIdiomRecognize::processLoopStore(StoreInst *SI, const SCEV *BECount) {
|
||||
if (SI->isVolatile()) return false;
|
||||
if (!SI->isSimple()) return false;
|
||||
|
||||
Value *StoredVal = SI->getValueOperand();
|
||||
Value *StorePtr = SI->getPointerOperand();
|
||||
@ -314,7 +314,7 @@ bool LoopIdiomRecognize::processLoopStore(StoreInst *SI, const SCEV *BECount) {
|
||||
const SCEVAddRecExpr *LoadEv =
|
||||
dyn_cast<SCEVAddRecExpr>(SE->getSCEV(LI->getOperand(0)));
|
||||
if (LoadEv && LoadEv->getLoop() == CurLoop && LoadEv->isAffine() &&
|
||||
StoreEv->getOperand(1) == LoadEv->getOperand(1) && !LI->isVolatile())
|
||||
StoreEv->getOperand(1) == LoadEv->getOperand(1) && LI->isSimple())
|
||||
if (processLoopStoreOfLoopLoad(SI, StoreSize, StoreEv, LoadEv, BECount))
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user