[PATCH] D59787: [ARM] Implement TTI::getMemcpyCost

Sjoerd Meijer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 07:29:54 PDT 2019


SjoerdMeijer updated this revision to Diff 196444.
SjoerdMeijer added a reviewer: samparker.
SjoerdMeijer added a comment.

Removed the change in `findOptimalMemOpLowering`, because that belongs to D59766 <https://reviews.llvm.org/D59766> which I have just updated.

About the regression: in my local tree had a logic error in `findOptimalMemOpLowering`, i.e. the condition to bail early was wrong. It was right here in the upstream diffs, so somehow I managed to mess that up).

Now, the good news is that the regressions disappear, In fact, there are no changes at all anymore. Because of the logic error, is was triggering more often, also for other intrinsics. Thus, this is now almost a non-functional change, which is what I was expecting as this is just the initial plumbing to model the cost correctly.

Investigating the "regressions" was a useful exercise though. I learned that in libPNG it was actually making the right decisions, but we were unlucky with register allocation allocating high registers like R9 <https://reviews.llvm.org/source/libcxxabi/> and R10 <https://reviews.llvm.org/source/test-suite/> not allowing narrow encodings for instructions LDRB and STRB. The other regression, in TEEM, was because it was also transforming memset intrinsics to eabi_memclr4 calls. This was just wrong, and was an result of not bailing early in `findOptimalMemOpLowering`. But this shows I definitely want to look at removing this early bail in a follow-up patch, because with the memclr things fixed, it should be a win overall and reduce code-size.

But summarising: this is not causing any changes in codesize for two code-bases CSiBe and Mbed, and thus is almost a non-functional change, which was my intention.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59787/new/

https://reviews.llvm.org/D59787

Files:
  lib/Analysis/TargetTransformInfo.cpp
  lib/Target/ARM/ARMTargetTransformInfo.cpp
  lib/Target/ARM/ARMTargetTransformInfo.h
  test/Analysis/CostModel/ARM/memcpy.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59787.196444.patch
Type: text/x-patch
Size: 15627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/eef51531/attachment.bin>


More information about the llvm-commits mailing list