]> granicus.if.org Git - llvm/commit
[APInt] Simplify the zext and sext methods
authorCraig Topper <craig.topper@gmail.com>
Mon, 24 Apr 2017 17:37:10 +0000 (17:37 +0000)
committerCraig Topper <craig.topper@gmail.com>
Mon, 24 Apr 2017 17:37:10 +0000 (17:37 +0000)
commit36e5af50c1440d0e81b17ce6792b259f56deb42f
treea4a43d2cfc9f219f5e8833d60085b1bc0dc66b69
parente6dc33fc170335b32b6b132c2c71377dc5ab09e0
[APInt] Simplify the zext and sext methods

This replaces a hand written copy loop with a call to memcpy for both zext and sext.

For sext, it replaces multiple if/else blocks propagating sign information forward. Now we just do a copy, a sign extension on the last copied word, a memset, and clearUnusedBits.

Differential Revision: https://reviews.llvm.org/D32417

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301201 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/APInt.cpp