@@ -1975,19 +1975,10 @@ insertRelocationStores(iterator_range<Value::user_iterator> GCRelocs,
1975
1975
assert (AllocaMap.count (OriginalValue));
1976
1976
Value *Alloca = AllocaMap[OriginalValue];
1977
1977
1978
- // Emit store into the related alloca
1979
- // All gc_relocates are i8 addrspace(1)* typed, and it must be bitcasted to
1980
- // the correct type according to alloca.
1978
+ // Emit store into the related alloca.
1981
1979
assert (Relocate->getNextNode () &&
1982
1980
" Should always have one since it's not a terminator" );
1983
- IRBuilder<> Builder (Relocate->getNextNode ());
1984
- Value *CastedRelocatedValue =
1985
- Builder.CreateBitCast (Relocate,
1986
- cast<AllocaInst>(Alloca)->getAllocatedType (),
1987
- suffixed_name_or (Relocate, " .casted" , " " ));
1988
-
1989
- new StoreInst (CastedRelocatedValue, Alloca,
1990
- cast<Instruction>(CastedRelocatedValue)->getNextNode ());
1981
+ new StoreInst (Relocate, Alloca, Relocate->getNextNode ());
1991
1982
1992
1983
#ifndef NDEBUG
1993
1984
VisitedLiveValues.insert (OriginalValue);
@@ -2620,13 +2611,9 @@ static bool inlineGetBaseAndOffset(Function &F,
2620
2611
Value *Base =
2621
2612
findBasePointer (Callsite->getOperand (0 ), DVCache, KnownBases);
2622
2613
assert (!DVCache.count (Callsite));
2623
- auto *BaseBC = IRBuilder<>(Callsite).CreateBitCast (
2624
- Base, Callsite->getType (), suffixed_name_or (Base, " .cast" , " " ));
2625
- if (BaseBC != Base)
2626
- DVCache[BaseBC] = Base;
2627
- Callsite->replaceAllUsesWith (BaseBC);
2628
- if (!BaseBC->hasName ())
2629
- BaseBC->takeName (Callsite);
2614
+ Callsite->replaceAllUsesWith (Base);
2615
+ if (!Base->hasName ())
2616
+ Base->takeName (Callsite);
2630
2617
Callsite->eraseFromParent ();
2631
2618
break ;
2632
2619
}
0 commit comments