[PATCH] D12710: InstCombine: Preserve tbaa metadata when merging loads that are phi arguments

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 15:37:04 PDT 2015


hfinkel 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));
 
----------------
ahatanak wrote:
> 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.
> 
I don't think that fpmath applies to loads, but range does, and yes, you should include that too.



http://reviews.llvm.org/D12710





More information about the llvm-commits mailing list