mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Misc mid-level changes for new 'fence' instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136205 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -665,7 +665,7 @@ bool DSE::handleEndBlock(BasicBlock &BB) {
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
AliasAnalysis::Location LoadedLoc;
|
||||
|
||||
// If we encounter a use of the pointer, it is no longer considered dead
|
||||
@@ -675,9 +675,12 @@ bool DSE::handleEndBlock(BasicBlock &BB) {
|
||||
LoadedLoc = AA->getLocation(V);
|
||||
} else if (MemTransferInst *MTI = dyn_cast<MemTransferInst>(BBI)) {
|
||||
LoadedLoc = AA->getLocationForSource(MTI);
|
||||
} else {
|
||||
// Not a loading instruction.
|
||||
} else if (!BBI->mayReadOrWriteMemory()) {
|
||||
// Instruction doesn't touch memory.
|
||||
continue;
|
||||
} else {
|
||||
// Unknown inst; assume it clobbers everything.
|
||||
break;
|
||||
}
|
||||
|
||||
// Remove any allocas from the DeadPointer set that are loaded, as this
|
||||
|
@@ -115,6 +115,11 @@ static bool LowerAtomicIntrinsic(IntrinsicInst *II) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool LowerFenceInst(FenceInst *FI) {
|
||||
FI->eraseFromParent();
|
||||
return true;
|
||||
}
|
||||
|
||||
namespace {
|
||||
struct LowerAtomic : public BasicBlockPass {
|
||||
static char ID;
|
||||
@@ -123,9 +128,13 @@ namespace {
|
||||
}
|
||||
bool runOnBasicBlock(BasicBlock &BB) {
|
||||
bool Changed = false;
|
||||
for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; )
|
||||
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(DI++))
|
||||
for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) {
|
||||
Instruction *Inst = DI++;
|
||||
if (IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst))
|
||||
Changed |= LowerAtomicIntrinsic(II);
|
||||
if (FenceInst *FI = dyn_cast<FenceInst>(Inst))
|
||||
Changed |= LowerFenceInst(FI);
|
||||
}
|
||||
return Changed;
|
||||
}
|
||||
};
|
||||
|
@@ -530,6 +530,7 @@ private:
|
||||
void visitCallSite (CallSite CS);
|
||||
void visitUnwindInst (TerminatorInst &I) { /*returns void*/ }
|
||||
void visitUnreachableInst(TerminatorInst &I) { /*returns void*/ }
|
||||
void visitFenceInst (FenceInst &I) { /*returns void*/ }
|
||||
void visitAllocaInst (Instruction &I) { markOverdefined(&I); }
|
||||
void visitVAArgInst (Instruction &I) { markAnythingOverdefined(&I); }
|
||||
|
||||
|
Reference in New Issue
Block a user