mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
NFC: skip FenceInst up-front in AtomicExpandPass.
llvm-svn: 264583
This commit is contained in:
parent
bd3e938f88
commit
387d85aaa9
@ -86,9 +86,10 @@ bool AtomicExpand::runOnFunction(Function &F) {
|
||||
|
||||
// Changing control-flow while iterating through it is a bad idea, so gather a
|
||||
// list of all atomic instructions before we start.
|
||||
for (inst_iterator I = inst_begin(F), E = inst_end(F); I != E; ++I) {
|
||||
if (I->isAtomic())
|
||||
AtomicInsts.push_back(&*I);
|
||||
for (inst_iterator II = inst_begin(F), E = inst_end(F); II != E; ++II) {
|
||||
Instruction *I = &*II;
|
||||
if (I->isAtomic() && !isa<FenceInst>(I))
|
||||
AtomicInsts.push_back(I);
|
||||
}
|
||||
|
||||
bool MadeChange = false;
|
||||
@ -97,8 +98,7 @@ bool AtomicExpand::runOnFunction(Function &F) {
|
||||
auto SI = dyn_cast<StoreInst>(I);
|
||||
auto RMWI = dyn_cast<AtomicRMWInst>(I);
|
||||
auto CASI = dyn_cast<AtomicCmpXchgInst>(I);
|
||||
assert((LI || SI || RMWI || CASI || isa<FenceInst>(I)) &&
|
||||
"Unknown atomic instruction");
|
||||
assert((LI || SI || RMWI || CASI) && "Unknown atomic instruction");
|
||||
|
||||
if (TLI->shouldInsertFencesForAtomic(I)) {
|
||||
auto FenceOrdering = Monotonic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user