[PATCH] D38378: Optimize {s,u}{add,sub}.with.overflow on ARM.

Joel Galenson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 14:45:00 PDT 2017


jgalenson updated this revision to Diff 117225.
jgalenson retitled this revision from "Optimize {s|u}add.with.overflow on ARM." to "Optimize {s,u}{add,sub}.with.overflow on ARM.".
jgalenson added a reviewer: kristof.beyls.
jgalenson added a comment.

Hi Kristof,

Yes, this in theory could improve performance and code size in general, not just with the overflow intrinsics.  I hadn't thought about that, though, so I hadn't looked into it before.  I just ran a couple smallish benchmarks and saw no change (I did, however, find a bug in my patch, so it was useful!), so I doubt it makes a large difference, but further testing would be good.  Unfortunately, I'm busy with something else at the moment, and I won't have too much time on this for at least a few days.

As for generalizing this patch, I believe you're right, although I don't actually know ARM very well.  But, for example, I would think we could use an ANDS to replace a CMP EQ.  My guess is that these would be relatively uncommon, but I could certainly be wrong, so it probably would be useful to look into this more.


https://reviews.llvm.org/D38378

Files:
  lib/Target/ARM/ARMBaseInstrInfo.cpp
  lib/Target/ARM/ARMBaseInstrInfo.h
  test/CodeGen/ARM/intrinsics-overflow.ll
  test/CodeGen/ARM/su-addsub-overflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38378.117225.patch
Type: text/x-patch
Size: 12168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170929/5423694f/attachment.bin>


More information about the llvm-commits mailing list