[APInt] In sext single word case, use SignExtend64 and let the APInt constructor...
authorCraig Topper <craig.topper@gmail.com>
Sun, 23 Apr 2017 17:16:24 +0000 (17:16 +0000)
committerCraig Topper <craig.topper@gmail.com>
Sun, 23 Apr 2017 17:16:24 +0000 (17:16 +0000)
commit652ca99622954c5373427bbd51257b7f23b61aed
tree18ca1c16ad7b858aecfa32df904f5800e4dd4120
parentdd9a4b9ae80b12f93ca33620a3de0907e81dfe7b
[APInt] In sext single word case, use SignExtend64 and let the APInt constructor mask off any excess bits.

The current code is trying to be clever with shifts to avoid needing to clear unused bits. But it looks like the compiler is unable to optimize out the unused bit handling in the APInt constructor. Given this its better to just use SignExtend64 and have more readable code.

llvm-svn: 301133
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp