diff options
author | Andrew Trick <atrick@apple.com> | 2014-01-09 00:22:31 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2014-01-09 00:22:31 +0000 |
commit | 32e1be7bd0fa651cc9240ffb082ccd7e8ae319ce (patch) | |
tree | 20fb4eb621c1f6d44534bd730a3e2c03cc341fbc /llvm/lib | |
parent | 0d84069e1766c00af5ae6658b2f0d539f4524762 (diff) | |
download | bcm5719-llvm-32e1be7bd0fa651cc9240ffb082ccd7e8ae319ce.tar.gz bcm5719-llvm-32e1be7bd0fa651cc9240ffb082ccd7e8ae319ce.zip |
llvm.experimental.stackmap: fix encoding of large constants.
In the stackmap format we advertise the constant field as signed.
However, we were determining whether to promote to a 64-bit constant
pool based on an unsigned comparison.
This fix allows -1 to be encoded as a small constant.
llvm-svn: 198816
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/StackMaps.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StackMaps.cpp b/llvm/lib/CodeGen/StackMaps.cpp index 1dc76d5c6a6..d70e6b30448 100644 --- a/llvm/lib/CodeGen/StackMaps.cpp +++ b/llvm/lib/CodeGen/StackMaps.cpp @@ -207,7 +207,10 @@ void StackMaps::recordStackMapOpers(const MachineInstr &MI, uint64_t ID, // Move large constants into the constant pool. for (LocationVec::iterator I = Locations.begin(), E = Locations.end(); I != E; ++I) { - if (I->LocType == Location::Constant && (I->Offset & ~0xFFFFFFFFULL)) { + // 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) { I->LocType = Location::ConstantIndex; I->Offset = ConstPool.getConstantIndex(I->Offset); } |