[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 14:01:22 PDT 2017


eraman added inline comments.


================
Comment at: lib/IR/Instruction.cpp:658
+  assert((isa<CallInst>(this) || isa<InvokeInst>(this)) &&
+         "Can only set weights for call instruciton");
+  if (W == 0)
----------------
Nit: "...call and invoke instructions"


================
Comment at: lib/IR/Instruction.cpp:659
+         "Can only set weights for call instruciton");
+  if (W == 0)
+    return;
----------------
Why is this guard needed? Is there a difference in handling an instruction with no metadata and one with a call weight of 0?


================
Comment at: test/Transforms/DeadArgElim/prof.ll:1
+; RUN: opt -deadargelim -S < %s | FileCheck %s
+
----------------
Nit: the file name is not very meaningful.


================
Comment at: test/Transforms/DeadArgElim/prof.ll:3
+
+; Checks if !prof metadata is reserved in deadargelim.
+
----------------
reserved?


https://reviews.llvm.org/D31143





More information about the llvm-commits mailing list