[PATCH] D21736: [InstrProfiling] Mark __llvm_profile_instrument_target last parameter as i32 zeroext if appropriate.

Vedant Kumar via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 26 15:33:19 PDT 2016


vsk added subscribers: davidxl, vsk.
vsk added a comment.

@davidxl would be a good reviewer for this.


================
Comment at: include/llvm/Analysis/TargetLibraryInfo.h:178
@@ +177,3 @@
+  ///  signext or zeroext attributes, respectively.
+  void setShouldExtI32(bool Param, bool Return) {
+    ShouldExtI32Param = Param;
----------------
Could you split this up into two setters, to better match the getters below?

================
Comment at: include/llvm/Transforms/InstrProfiling.h:35
@@ -32,3 +34,3 @@
   PreservedAnalyses run(Module &M, AnalysisManager<Module> &AM);
-  bool run(Module &M);
+  bool run(Module &M, const TargetLibraryInfo *TLI);
 
----------------
It appears that `TLI` is assumed to be non-null. Can you make this a reference?

================
Comment at: lib/Transforms/Instrumentation/InstrProfiling.cpp:177
@@ -167,2 +176,3 @@
 
-static Constant *getOrInsertValueProfilingCall(Module &M) {
+static Constant *getOrInsertValueProfilingCall(Module &M,
+                                               const TargetLibraryInfo *TLI) {
----------------
Unrelated to this patch, but: it seems weird that this is called every time we do a lowerValueProfileInst(). Can we just do it once per run?


Repository:
  rL LLVM

http://reviews.llvm.org/D21736





More information about the llvm-commits mailing list