[PATCH] D31772: [PowerPC] Add pass to expand extra memcpy calls

Hiroshi Inoue via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 05:15:46 PDT 2017


inouehrs added inline comments.


================
Comment at: lib/Target/PowerPC/PPCLowerMemIntrinsics.cpp:84
+// Checks whether the cpu arch is one where we want to expand
+// memcpy calls. We expand for little-endian PPC cpus.
+static bool CPUCheck(const std::string &CpuStr) {
----------------
sfertile wrote:
> nemanjai wrote:
> > Umm, this is kind of meaningless. Technically, PowerPC CPU's have been capable of running in both little-endian and big-endian mode for about 4-5 generations. If the pass does not check endianness, there's no real need to mention it here.
> I added 'ppc64le' since that is the default target_cpu on little-endian.  I thought that little-endian was only officially supported  starting in Power8, so having a LE cpu indicated Power8 or above for the architecture.  If thats not the case I can rethink this switch.
Why not test `DataLayout.isLittleEndian()`?
I think PPC chips has been bi-endian for a long time (e.g. ancient Windows NT for PPC ran in little-endian mode). But the LE Linux supports POWER8 and later, but BE Linux also runs on P8.


================
Comment at: lib/Target/PowerPC/PPCTargetTransformInfo.h:89
                                  unsigned AddressSpace);
-
+  Type *getMemcpyLoopLoweringType(LLVMContext &Context, Value *Length,
+                                  unsigned SrcAlign, unsigned DestAlign) const;
----------------
Currently, there is no use of these two methods. Do you add them for the subsequent patches?


Repository:
  rL LLVM

https://reviews.llvm.org/D31772





More information about the llvm-commits mailing list