[PATCH] D33243: [Atomics][LoopIdiom] Recognize unordered atomic memcpy

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 07:51:01 PDT 2017


anna added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfoImpl.h:429
+    // in RuntimeLibcalls.h
+    return 4;
+  }
----------------
dneilson wrote:
> reames wrote:
> > Why 4?  0 would seem like a safer default.
> Good point, zero would seem safer...  I put in 4 because my original intent was to put in getRegisterBitWidth()/8 & the default reg bit width is 32 -- I couldn't do that because the call here would get bound to the getRegisterBitWidth() in this base class, and would never see the platform-specific value.
So, again it maybe the case that `getRegisterBitWidth()/8` may not have the corresponding libcall defined for the target. I have a mild preference to leave it to the target to confirm they have valid definitions for these libcall sizes (i.e. having 0 as the default in the base definition). 


https://reviews.llvm.org/D33243





More information about the llvm-commits mailing list