Change logic in StackMaps::recordStackMapOpers to use the isInt<32>
authorSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 4 Nov 2014 00:06:57 +0000 (00:06 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Tue, 4 Nov 2014 00:06:57 +0000 (00:06 +0000)
predicate instead of bitwise operations.

This is not a functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221209 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/StackMaps.cpp

index a32a7c150c405568d84c5ff8458e150ef2ca6835..967cf751f36bf7f254088f28bec5442514dbca00 100644 (file)
@@ -220,8 +220,7 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID,
        I != E; ++I) {
     // Constants are encoded as sign-extended integers.
     // -1 is directly encoded as .long 0xFFFFFFFF with no constant pool.
-    if (I->LocType == Location::Constant &&
-        ((I->Offset + (int64_t(1)<<31)) >> 32) != 0) {
+    if (I->LocType == Location::Constant && !isInt<32>(I->Offset)) {
       I->LocType = Location::ConstantIndex;
       auto Result = ConstPool.insert(std::make_pair(I->Offset, I->Offset));
       I->Offset = Result.first - ConstPool.begin();