[llvm] r221209 - Change logic in StackMaps::recordStackMapOpers to use the isInt<32>

Sanjoy Das sanjoy at playingwithpointers.com
Mon Nov 3 16:06:57 PST 2014


Author: sanjoy
Date: Mon Nov  3 18:06:57 2014
New Revision: 221209

URL: http://llvm.org/viewvc/llvm-project?rev=221209&view=rev
Log:
Change logic in StackMaps::recordStackMapOpers to use the isInt<32>
predicate instead of bitwise operations.

This is not a functional change.


Modified:
    llvm/trunk/lib/CodeGen/StackMaps.cpp

Modified: llvm/trunk/lib/CodeGen/StackMaps.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StackMaps.cpp?rev=221209&r1=221208&r2=221209&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StackMaps.cpp (original)
+++ llvm/trunk/lib/CodeGen/StackMaps.cpp Mon Nov  3 18:06:57 2014
@@ -220,8 +220,7 @@ void StackMaps::recordStackMapOpers(cons
        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();





More information about the llvm-commits mailing list