mcrosier added a subscriber: mcrosier.
mcrosier added a comment.

I believe the LLVM blog post is in error.  Loop vectorization commonly 
generates two versions of the loop: vectorized and scalar.  The scalar loop is 
necessary to handle the case where the trip count isn't evenly divisible by the 
vectorization factor.  Therefore, it's reasonable to disable these type of 
optimizations (e.g., vectorization, unrolling) when we're optimizing for size.  
It's also reasonable to disable these optimizations at -O0.

However, I also understand the argument being made by Chandler.  Can you please 
create an LLVM patch the shows the loop unroll pass respects the equivalent 
-Os/-Oz/-O0 in LLVM IR?

I believe the first two are handled by checking Function::optForSize() and for 
the latter you can check the function for the optnone attribute.


Repository:
  rL LLVM

http://reviews.llvm.org/D19827



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to