mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198816 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user