diff options
author | James Y Knight <jyknight@google.com> | 2016-03-28 15:05:30 +0000 |
---|---|---|
committer | James Y Knight <jyknight@google.com> | 2016-03-28 15:05:30 +0000 |
commit | 01f2ca5612127b4ff44e3eb4a63da24627341df8 (patch) | |
tree | 4615c235c2d2d9bc8b7e8e393fc6bdffead388c7 /llvm/lib/CodeGen | |
parent | f21a0c6372bec175102e305b33d4eefc614a94cb (diff) | |
download | bcm5719-llvm-01f2ca5612127b4ff44e3eb4a63da24627341df8.tar.gz bcm5719-llvm-01f2ca5612127b4ff44e3eb4a63da24627341df8.zip |
NFC: skip FenceInst up-front in AtomicExpandPass.
llvm-svn: 264583
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AtomicExpandPass.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp index c7e7efd2282..40140e41a03 100644 --- a/llvm/lib/CodeGen/AtomicExpandPass.cpp +++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp @@ -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; |