@@ -126,7 +126,6 @@ class SimplifyStructRegSignatures : public ModulePass {
126
126
DenseSet<Function *> FunctionsToDelete;
127
127
SetVector<CallInst *> CallsToPatch;
128
128
SetVector<InvokeInst *> InvokesToPatch;
129
- SetVector<BitCastInst *> BitCastsToPatch;
130
129
DenseMap<Function *, Function *> FunctionMap;
131
130
132
131
struct FunctionAddressing {
@@ -437,10 +436,6 @@ void SimplifyStructRegSignatures::scheduleInstructionsForCleanup(
437
436
CallsToPatch.insert (Call);
438
437
} else if (InvokeInst *Invoke = dyn_cast<InvokeInst>(&IIter)) {
439
438
InvokesToPatch.insert (Invoke);
440
- } else if (BitCastInst *BitCast = dyn_cast<BitCastInst>(&IIter)) {
441
- if (isa<Function>(BitCast->getOperand (0 ))) {
442
- BitCastsToPatch.insert (BitCast);
443
- }
444
439
}
445
440
}
446
441
}
@@ -542,16 +537,6 @@ bool SimplifyStructRegSignatures::runOnModule(Module &M) {
542
537
fixCallSite (Ctx, InvokeToFix, PreferredAlignment);
543
538
}
544
539
545
- // BitCasts of a function we are modifying must be corrected
546
- for (auto &BitCastToFix : BitCastsToPatch) {
547
- auto *Old = cast<Function>(BitCastToFix->getOperand (0 ));
548
- if (FunctionMap.find (Old) != FunctionMap.end ()) {
549
- auto *New = FunctionMap[Old];
550
- IRBuilder<> Builder (BitCastToFix);
551
- BitCastToFix->setOperand (0 , Builder.CreateBitCast (New, Old->getType (), " bitcastfixcast" ));
552
- }
553
- }
554
-
555
540
// Update taking of a function's address from a parameter
556
541
for (auto &Addressing : FunctionAddressings) {
557
542
Value *Temp = Addressing.Temp ;
0 commit comments