[PATCH] D78451: [CallSite removal][WebAssembly] Replace CallSite with CallBase in WebAssemblyOptimizeReturned.
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 19 19:13:03 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4ecc8fb7ebda: [CallSite removal][WebAssembly] Replace CallSite with CallBase in… (authored by craig.topper).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78451/new/
https://reviews.llvm.org/D78451
Files:
llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp
Index: llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyOptimizeReturned.cpp
@@ -42,7 +42,7 @@
static char ID;
OptimizeReturned() : FunctionPass(ID) {}
- void visitCallSite(CallSite CS);
+ void visitCallBase(CallBase &CB);
};
} // End anonymous namespace
@@ -55,17 +55,16 @@
return new OptimizeReturned();
}
-void OptimizeReturned::visitCallSite(CallSite CS) {
- for (unsigned I = 0, E = CS.getNumArgOperands(); I < E; ++I)
- if (CS.paramHasAttr(I, Attribute::Returned)) {
- Instruction *Inst = CS.getInstruction();
- Value *Arg = CS.getArgOperand(I);
+void OptimizeReturned::visitCallBase(CallBase &CB) {
+ for (unsigned I = 0, E = CB.getNumArgOperands(); I < E; ++I)
+ if (CB.paramHasAttr(I, Attribute::Returned)) {
+ Value *Arg = CB.getArgOperand(I);
// Ignore constants, globals, undef, etc.
if (isa<Constant>(Arg))
continue;
// Like replaceDominatedUsesWith but using Instruction/Use dominance.
- Arg->replaceUsesWithIf(Inst,
- [&](Use &U) { return DT->dominates(Inst, U); });
+ Arg->replaceUsesWithIf(&CB,
+ [&](Use &U) { return DT->dominates(&CB, U); });
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D78451.258639.patch
Type: text/x-patch
Size: 1399 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200420/6462f3ed/attachment.bin>
More information about the llvm-commits
mailing list