[PATCH] D12710: InstCombine: Preserve tbaa metadata when merging loads that are phi arguments
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 13:04:00 PDT 2015
ahatanak added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombinePHI.cpp:355
@@ -352,1 +354,3 @@
+ NewLI->setMetadata(LLVMContext::MD_tbaa,
+ FirstLI->getMetadata(LLVMContext::MD_tbaa));
----------------
hfinkel wrote:
> Why are you preserving only TBAA? I think that you could also preserve here:
>
> MD_alias_scope
> MD_noalias
> MD_invariant_load
> MD_nonnull
>
> using combineMetadata.
>
Yes, I think you are right. I didn't look at the other metadata since tbaa was the only one that I had to fix for my use case.
Is there a reason you left out the other two (range and fpmath) that are combined in combineMetadata? It seems to me that they can be attached to load instructions and should be preserved too.
http://reviews.llvm.org/D12710
More information about the llvm-commits
mailing list