Rework the routines that convert AP[S]Int into a string. Now, instead of
returning an std::string by value, it fills in a SmallString/SmallVector passed in. This significantly reduces string thrashing in some cases. More specifically, this: - Adds an operator<< and a print method for APInt that allows you to directly send them to an ostream. - Reimplements APInt::toString to be much simpler and more efficient algorithmically in addition to not thrashing strings quite as much. This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the asmprinter. This also fixes a bug I introduced into the asmwriter in a previous patch w.r.t. alias printing. llvm-svn: 54873
Showing
- llvm/examples/Fibonacci/fibonacci.cpp 1 addition, 1 deletionllvm/examples/Fibonacci/fibonacci.cpp
- llvm/examples/HowToUseJIT/HowToUseJIT.cpp 1 addition, 1 deletionllvm/examples/HowToUseJIT/HowToUseJIT.cpp
- llvm/include/llvm/ADT/APInt.h 25 additions, 12 deletionsllvm/include/llvm/ADT/APInt.h
- llvm/include/llvm/ADT/APSInt.h 14 additions, 4 deletionsllvm/include/llvm/ADT/APSInt.h
- llvm/lib/AsmParser/ParserInternals.h 1 addition, 1 deletionllvm/lib/AsmParser/ParserInternals.h
- llvm/lib/CodeGen/AsmPrinter.cpp 9 additions, 6 deletionsllvm/lib/CodeGen/AsmPrinter.cpp
- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp 1 addition, 1 deletionllvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
- llvm/lib/Support/APFloat.cpp 1 addition, 2 deletionsllvm/lib/Support/APFloat.cpp
- llvm/lib/Support/APInt.cpp 98 additions, 95 deletionsllvm/lib/Support/APInt.cpp
- llvm/lib/Support/ConstantRange.cpp 1 addition, 2 deletionsllvm/lib/Support/ConstantRange.cpp
- llvm/lib/Target/CppBackend/CPPBackend.cpp 2 additions, 2 deletionsllvm/lib/Target/CppBackend/CPPBackend.cpp
- llvm/lib/Transforms/Utils/LowerSwitch.cpp 3 additions, 5 deletionsllvm/lib/Transforms/Utils/LowerSwitch.cpp
- llvm/lib/VMCore/AsmWriter.cpp 12 additions, 7 deletionsllvm/lib/VMCore/AsmWriter.cpp
Loading
Please register or sign in to comment