mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Simplify code. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194602 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -216,12 +216,12 @@ bool Loop::isSafeToClone() const {
|
|||||||
// Return false if any loop blocks contain indirectbrs, or there are any calls
|
// Return false if any loop blocks contain indirectbrs, or there are any calls
|
||||||
// to noduplicate functions.
|
// to noduplicate functions.
|
||||||
for (Loop::block_iterator I = block_begin(), E = block_end(); I != E; ++I) {
|
for (Loop::block_iterator I = block_begin(), E = block_end(); I != E; ++I) {
|
||||||
if (isa<IndirectBrInst>((*I)->getTerminator())) {
|
if (isa<IndirectBrInst>((*I)->getTerminator()))
|
||||||
return false;
|
return false;
|
||||||
} else if (const InvokeInst *II = dyn_cast<InvokeInst>((*I)->getTerminator())) {
|
|
||||||
|
if (const InvokeInst *II = dyn_cast<InvokeInst>((*I)->getTerminator()))
|
||||||
if (II->hasFnAttr(Attribute::NoDuplicate))
|
if (II->hasFnAttr(Attribute::NoDuplicate))
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
for (BasicBlock::iterator BI = (*I)->begin(), BE = (*I)->end(); BI != BE; ++BI) {
|
for (BasicBlock::iterator BI = (*I)->begin(), BE = (*I)->end(); BI != BE; ++BI) {
|
||||||
if (const CallInst *CI = dyn_cast<CallInst>(BI)) {
|
if (const CallInst *CI = dyn_cast<CallInst>(BI)) {
|
||||||
@ -305,15 +305,15 @@ bool Loop::isAnnotatedParallel() const {
|
|||||||
if (!II->mayReadOrWriteMemory())
|
if (!II->mayReadOrWriteMemory())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!II->getMetadata("llvm.mem.parallel_loop_access"))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// The memory instruction can refer to the loop identifier metadata
|
// The memory instruction can refer to the loop identifier metadata
|
||||||
// directly or indirectly through another list metadata (in case of
|
// directly or indirectly through another list metadata (in case of
|
||||||
// nested parallel loops). The loop identifier metadata refers to
|
// nested parallel loops). The loop identifier metadata refers to
|
||||||
// itself so we can check both cases with the same routine.
|
// itself so we can check both cases with the same routine.
|
||||||
MDNode *loopIdMD =
|
MDNode *loopIdMD = II->getMetadata("llvm.mem.parallel_loop_access");
|
||||||
dyn_cast<MDNode>(II->getMetadata("llvm.mem.parallel_loop_access"));
|
|
||||||
|
if (!loopIdMD)
|
||||||
|
return false;
|
||||||
|
|
||||||
bool loopIdMDFound = false;
|
bool loopIdMDFound = false;
|
||||||
for (unsigned i = 0, e = loopIdMD->getNumOperands(); i < e; ++i) {
|
for (unsigned i = 0, e = loopIdMD->getNumOperands(); i < e; ++i) {
|
||||||
if (loopIdMD->getOperand(i) == desiredLoopIdMetadata) {
|
if (loopIdMD->getOperand(i) == desiredLoopIdMetadata) {
|
||||||
|
Reference in New Issue
Block a user