summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2016-04-26 02:06:06 +0000
committerHal Finkel <hfinkel@anl.gov>2016-04-26 02:06:06 +0000
commite4c0c1679b8a20836643cba98773fb1cdfb7afe8 (patch)
tree980e54fe009bf42976d15b7dc9aad6f017d77cde /llvm/lib
parent411d31ad72456ba88c0b0bee0faba2b774add65f (diff)
downloadbcm5719-llvm-e4c0c1679b8a20836643cba98773fb1cdfb7afe8.tar.gz
bcm5719-llvm-e4c0c1679b8a20836643cba98773fb1cdfb7afe8.zip
[SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging
When SimplifyCFG merges identical instructions from both sides of a diamond, it can preserve !llvm.mem.parallel_loop_access (as it does with most of the other metadata). There's no real data or control dependency change in this case. llvm-svn: 267515
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp1
-rw-r--r--llvm/lib/Transforms/Utils/SimplifyCFG.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index 75eda97d0a3..82961a678be 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1539,6 +1539,7 @@ void llvm::combineMetadata(Instruction *K, const Instruction *J,
K->setMetadata(Kind, MDNode::getMostGenericAliasScope(JMD, KMD));
break;
case LLVMContext::MD_noalias:
+ case LLVMContext::MD_mem_parallel_loop_access:
K->setMetadata(Kind, MDNode::intersect(JMD, KMD));
break;
case LLVMContext::MD_range:
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 23199b37b29..4239764ebc7 100644
--- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1143,7 +1143,8 @@ static bool HoistThenElseCodeToIf(BranchInst *BI,
LLVMContext::MD_fpmath, LLVMContext::MD_invariant_load,
LLVMContext::MD_nonnull, LLVMContext::MD_invariant_group,
LLVMContext::MD_align, LLVMContext::MD_dereferenceable,
- LLVMContext::MD_dereferenceable_or_null};
+ LLVMContext::MD_dereferenceable_or_null,
+ LLVMContext::MD_mem_parallel_loop_access};
combineMetadata(I1, I2, KnownIDs);
I2->eraseFromParent();
Changed = true;
OpenPOWER on IntegriCloud