diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-15 15:46:38 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-08-15 15:46:38 +0000 |
commit | ea46c32f818c40abc25451423f36628c274da6b6 (patch) | |
tree | 999f40b642d8bbc67827cf2e64fcd663eae0a8db /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 3e00116dc1ff3f992bd8fd155127e3ab0c8af801 (diff) | |
download | bcm5719-llvm-ea46c32f818c40abc25451423f36628c274da6b6.tar.gz bcm5719-llvm-ea46c32f818c40abc25451423f36628c274da6b6.zip |
Introduce a helper to combine instruction metadata.
Replace the old code in GVN and BBVectorize with it. Update SimplifyCFG to use
it.
Patch by Björn Steinbrink!
llvm-svn: 215723
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 63cb1c9abbf..cc3fbb19a6e 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -43,6 +43,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Transforms/Utils/BasicBlockUtils.h" +#include "llvm/Transforms/Utils/Local.h" #include <algorithm> #include <map> #include <set> @@ -1040,6 +1041,13 @@ static bool HoistThenElseCodeToIf(BranchInst *BI, const DataLayout *DL) { if (!I2->use_empty()) I2->replaceAllUsesWith(I1); I1->intersectOptionalDataWith(I2); + unsigned KnownIDs[] = { + LLVMContext::MD_tbaa, + LLVMContext::MD_range, + LLVMContext::MD_fpmath, + LLVMContext::MD_invariant_load + }; + combineMetadata(I1, I2, KnownIDs); I2->eraseFromParent(); Changed = true; |