[llvm-dev] Question about llvm::Value::print performance

Dr.-Ing. Christoph Cullmann via llvm-dev llvm-dev at lists.llvm.org
Sun Jun 11 08:21:44 PDT 2017


Hi,

> Hi,
> 
>> Hi Christoph,
>> 
>> is it possible to reduce the amount of "work" for every process and
>> iterate over all functions in different processes?
>> I mean: Debug the first 100 functions, then in the socond step, debug
>> function 101 till 200, and so on. So you summarize and complete your
>> result over several, standalone debugs steps.
> not really, I need the graph with instruction labels in one go, as it will be
> used to visualize things,
> e.g. like this example that works on PPC assembly. (a bit like writing a dot
> graph of the IR)
> 
> https://www.absint.com/stackanalyzer/shot5.png
> 
> Beside, as the printing seems really like "per instruction redo all type
> importing and co."
> it won't even scale if I let all cores do things.
> 
> The AssemblyWriter that is internal has rather clever caching for that which I
> can't access
> from the outside, if I am not wrong.
> 
> But perhaps somebody has a clever way around this issue.

Would be some patch acceptable that allows to pass in some TypePrinting object to

void Value::print(raw_ostream &ROS, ModuleSlotTracker &MST,
                  bool IsForDebug) const

like it was done for the ModuleSlotTracker &MST parameter?

TypeFinder is already exposed, would it be possible to expose the

class TypePrinting {
  TypePrinting(const TypePrinting &) = delete;
  void operator=(const TypePrinting&) = delete;
public:

  /// NamedTypes - The named types that are used by the current module.
  TypeFinder NamedTypes;

  /// NumberedTypes - The numbered types, along with their value.
  DenseMap<StructType*, unsigned> NumberedTypes;

  TypePrinting() = default;

  void incorporateTypes(const Module &M);

  void print(Type *Ty, raw_ostream &OS);

  void printStructBody(StructType *Ty, raw_ostream &OS);
};

class for that purpose, too?

Greetings
Christoph

-- 
----------------------------- Dr.-Ing. Christoph Cullmann ---------
AbsInt Angewandte Informatik GmbH      Email: cullmann at AbsInt.com
Science Park 1                         Tel:   +49-681-38360-22
66123 Saarbrücken                      Fax:   +49-681-38360-20
GERMANY                                WWW:   http://www.AbsInt.com
--------------------------------------------------------------------
Geschäftsführung: Dr.-Ing. Christian Ferdinand
Eingetragen im Handelsregister des Amtsgerichts Saarbrücken, HRB 11234


More information about the llvm-dev mailing list