Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: lib/Transforms/Scalar/LowerAtomic.cpp

Issue 29743003: Add passes for applying SFI sandboxing at the LLVM IR level Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Retry upload Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Transforms/NaCl/StripTls.cpp ('k') | test/Transforms/NaCl/allocate-data-segment.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- LowerAtomic.cpp - Lower atomic intrinsics --------------------------===// 1 //===- LowerAtomic.cpp - Lower atomic intrinsics --------------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This pass lowers atomic intrinsics to non-atomic form for use in a known 10 // This pass lowers atomic intrinsics to non-atomic form for use in a known
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 bool Changed = false; 115 bool Changed = false;
116 for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) { 116 for (BasicBlock::iterator DI = BB.begin(), DE = BB.end(); DI != DE; ) {
117 Instruction *Inst = DI++; 117 Instruction *Inst = DI++;
118 if (FenceInst *FI = dyn_cast<FenceInst>(Inst)) 118 if (FenceInst *FI = dyn_cast<FenceInst>(Inst))
119 Changed |= LowerFenceInst(FI); 119 Changed |= LowerFenceInst(FI);
120 else if (AtomicCmpXchgInst *CXI = dyn_cast<AtomicCmpXchgInst>(Inst)) 120 else if (AtomicCmpXchgInst *CXI = dyn_cast<AtomicCmpXchgInst>(Inst))
121 Changed |= LowerAtomicCmpXchgInst(CXI); 121 Changed |= LowerAtomicCmpXchgInst(CXI);
122 else if (AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(Inst)) 122 else if (AtomicRMWInst *RMWI = dyn_cast<AtomicRMWInst>(Inst))
123 Changed |= LowerAtomicRMWInst(RMWI); 123 Changed |= LowerAtomicRMWInst(RMWI);
124 else if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) { 124 else if (LoadInst *LI = dyn_cast<LoadInst>(Inst)) {
125 LI->setVolatile(false);
125 if (LI->isAtomic()) 126 if (LI->isAtomic())
126 LowerLoadInst(LI); 127 LowerLoadInst(LI);
127 } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) { 128 } else if (StoreInst *SI = dyn_cast<StoreInst>(Inst)) {
129 SI->setVolatile(false);
128 if (SI->isAtomic()) 130 if (SI->isAtomic())
129 LowerStoreInst(SI); 131 LowerStoreInst(SI);
130 } 132 }
131 } 133 }
132 return Changed; 134 return Changed;
133 } 135 }
134 }; 136 };
135 } 137 }
136 138
137 char LowerAtomic::ID = 0; 139 char LowerAtomic::ID = 0;
138 INITIALIZE_PASS(LowerAtomic, "loweratomic", 140 INITIALIZE_PASS(LowerAtomic, "loweratomic",
139 "Lower atomic intrinsics to non-atomic form", 141 "Lower atomic intrinsics to non-atomic form",
140 false, false) 142 false, false)
141 143
142 Pass *llvm::createLowerAtomicPass() { return new LowerAtomic(); } 144 Pass *llvm::createLowerAtomicPass() { return new LowerAtomic(); }
OLDNEW
« no previous file with comments | « lib/Transforms/NaCl/StripTls.cpp ('k') | test/Transforms/NaCl/allocate-data-segment.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698