[PATCH] D31143: Set the prof weight correctly for call instructions in DeadArgumentElimination.
Easwaran Raman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 22 17:03:20 PDT 2017
eraman added a comment.
LGTM after you fix the test case.
================
Comment at: lib/IR/Instruction.cpp:658
+ assert((isa<CallInst>(this) || isa<InvokeInst>(this)) &&
+ "Can only set weights for call and invoke instruciton");
+ SmallVector<uint32_t, 1> Weights;
----------------
Nit: "call and invoke instructions"
================
Comment at: test/Transforms/DeadArgElim/call_profile.ll:6
+; Function Attrs: uwtable
+define void @_Z2f2v() #0 {
+; CHECK: call void @_ZL2f1iz(), !prof ![[PROF:[0-9]]]
----------------
Could you add the test case for the non va_arg case as well? There are two places in the code where a new instruction is created and you should check both the cases (or optionally refactor the code so that the new instruction creation and metadata copying is done in one helper function)
https://reviews.llvm.org/D31143
More information about the llvm-commits
mailing list