Displaying 20 results from an estimated 2000 matches similar to: "raw_pwrite_stream on a non-fixed-size buffer?"
2016 Feb 19
3
raw_pwrite_stream to string or stdout?
TargetMachine::addPassesToEmitFile(..)
requires as its 2nd argument an raw_pwrite_stream.
Is it possible to create such a thing which either writes into a
standard string or streams to outs() ?
Thanks,
2016 Feb 22
2
raw_pwrite_stream to string or stdout?
TargetMachine::CGFT_AssemblyFile is exactly what I am trying to write out.
Frank
On 02/22/2016 11:06 AM, Rafael Espíndola wrote:
> On 19 February 2016 at 16:16, Frank Winter via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
>> TargetMachine::addPassesToEmitFile(..)
>> requires as its 2nd argument an raw_pwrite_stream.
>>
>> Is it possible to create such a
2016 Mar 23
2
Help with pass manager
Sorry in advance for the stupid question, i still don’t understand some concepts like passes.
I took a piece of code from llc, and I used it to write a function that creates an object (or assembly) file from an IR module.
It compiles without any problems. But program crashes when it reaches add() method of the pass manager.
Can you help me figuring out what’s the problem please? here is my
2015 May 02
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
+update diff
2015-05-02 7:38 GMT+03:00 Yaron Keren <yaron.keren at gmail.com>:
> I outlined (is that the right
> word?) raw_char_ostream::grow, raw_char_ostream::write (both) into
> raw_ostream.cpp with less than 10% difference in performance.
>
> Profiling reveals that the real culprit is the code line
>
> OS.reserve(OS.size() + 64);
>
> called from
2015 Apr 20
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
Sean, thanks for reminding this, Alp did commit a class derived from
raw_svector_ostream conatining an internal SmallString he called
small_string_ostream.
The commit was reverted after a day due to a disagreement about the commit
approval and apparently abandoned.
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223393.html
2016 Mar 24
2
Help with pass manager
The stack trace:
llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*)
llvm::PMTopLevelManager::schedulePass(llvm::Pass*)
moduleToObjectFile(llvm::Module*,std::string&,llvm::LLVMContext&)
Sometimes it doesn't crash because TargetRegistry::lookupTarget() returns an error which says it doesn't support the current target
> On Mar 24, 2016, at 1:14 AM, Mehdi Amini
2016 Mar 24
0
Help with pass manager
Assuming you are talking about this line:
passmanager.add(tliwp);
I don't see anything obviously wrong.
Are you hitting an assertion or a pure crash? (if LLVM not built with assertions, please rebuild).
What does your debugger gives you as a stracktrace?
--
Mehdi
> On Mar 23, 2016, at 3:44 PM, Lorenzo Laneve via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> Sorry in
2015 Apr 30
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
I don't think we should make flush virtual. Why do you need to do it?
Can't you set up the base class to write to use the tail of the memory
region as the buffer?
On 24 April 2015 at 06:46, Yaron Keren <yaron.keren at gmail.com> wrote:
> Hi,
>
> Is this what you're thinking about?
> The code is not tested yet, I'd like to know if the overall direction and
>
2015 May 02
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
Could you dig into why:
+ raw_ostream &write(unsigned char C) override {
+ grow(1);
+ *OutBufCur++ = C;
+ return *this;
+ }
Is 3 times as fast as raw_svector_ostream? I don't see a good reason why
that should be any faster than:
raw_ostream &operator<<(char C) {
if (OutBufCur >= OutBufEnd)
return write(C);
*OutBufCur++ = C;
return *this;
}
2015 Apr 19
6
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
A very common code pattern in LLVM is
SmallString<128> S;
raw_svector_ostream OS(S);
OS<< ...
Use OS.str()
While raw_svector_ostream is smart to share the text buffer itself, it's
inefficient keeping two sets of pointers to the same buffer:
In SmallString: void *BeginX, *EndX, *CapacityX
In raw_ostream: char *OutBufStart, *OutBufEnd, *OutBufCur
Moreover, at runtime the
2016 Mar 24
2
Help with pass manager
Sorry, that's a pure crash I think, assertions are not triggered.
Xcode doesn’t map those 2 functions to line numbers because they’re in precompiled libraries
On Mar 24, 2016, at 1:44 AM, Mehdi Amini <mehdi.amini at apple.com <mailto:mehdi.amini at apple.com>> wrote:
>
>> On Mar 23, 2016, at 5:41 PM, Lorenzo Laneve <lore97drk at icloud.com <mailto:lore97drk at
2015 May 22
2
[LLVMdev] SmallString + raw_svector_ostream combination should be more efficient
Here's a performance testcase for the raw_svector_ostream patch. On my
WIndows x64 machine it runs in 1010ms with the current code and in 440ms
with the patch applies. Is this OK to commit?
2015-05-02 21:31 GMT+03:00 Yaron Keren <yaron.keren at gmail.com>:
> Following a hint from Duncan in http://llvm.org/pr23395, here is a
> revised patch. Rather then introduce the
2016 Mar 24
0
Help with pass manager
> On Mar 23, 2016, at 5:41 PM, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> The stack trace:
> llvm::PMTopLevelManager::addImmutablePass(llvm::ImmutablePass*)
> llvm::PMTopLevelManager::schedulePass(llvm::Pass*)
> moduleToObjectFile(llvm::Module*,std::string&,llvm::LLVMContext&)
Without mapping to line numbers this is not very helpful: moduleToObjectFile
2016 Mar 24
2
Help with pass manager
I’m using LLVM 3.8.0, and no, it’s the precompiled version
That’s why it doesn’t give me enough info for debug
> On 24 Mar 2016, at 1:53 AM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
> This code path is not likely to crash usually. Did you build LLVM yourself? Which version are you using and can you reduce the test case to be "minimal" so that someone can
2016 Mar 24
0
Help with pass manager
This code path is not likely to crash usually. Did you build LLVM yourself? Which version are you using and can you reduce the test case to be "minimal" so that someone can reproduce?
(for instance you don't need a module to create a pass manager)
--
Mehdi
> On Mar 23, 2016, at 5:50 PM, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> Sorry, that's a pure
2016 Mar 24
2
Help with pass manager
You may want to try adding this code (copy/pasted from llc.cpp):
// Initialize targets first, so that --version shows registered targets.
InitializeAllTargets();
InitializeAllTargetMCs();
InitializeAllAsmPrinters();
InitializeAllAsmParsers();
// Initialize codegen and IR passes used by llc so that the -print-after,
// -print-before, and -stop-after options work.
PassRegistry
2016 Feb 22
2
raw_pwrite_stream to string or stdout?
Note that raw_fd_ostream is not seekable, and hence will not be suitable as
addPassesToEmitFile output stream.
2016-02-22 18:27 GMT+02:00 Rafael Espíndola <llvm-dev at lists.llvm.org>:
> On 22 February 2016 at 11:16, Frank Winter <fwinter at jlab.org> wrote:
> > TargetMachine::CGFT_AssemblyFile is exactly what I am trying to write
> out.
>
> I see.
>
> For
2015 Aug 12
2
SmallString + raw_svector_ostream combination should be more efficient
+llvm-dev at lists.llvm.org
The impact should be small as all the other streamers usually write
directly to the memory buffer and only when out of buffer they call write().
OTOH, raw_svector_ostream (without a buffer) goes though write for every
character or block it writes. It can work without virtual write() by
overriding the existing virtual write_impl() but this is a slower code path
for
2016 Mar 24
0
Help with pass manager
Update:
Sorry my bad. I built llvm and tried it with debugging version.
It was an assertion (IR/LegacyPassManager.cpp:764) saying that it expects all immutable passes to be initialized.
> On Mar 24, 2016, at 2:00 AM, Lorenzo Laneve <lore97drk at icloud.com> wrote:
>
> I’m using LLVM 3.8.0, and no, it’s the precompiled version
> That’s why it doesn’t give me enough info for
2016 Mar 24
0
Help with pass manager
Those lines of code are in a function that is called before calling the moduleToObjectFile() function
> On Mar 24, 2016, at 6:07 PM, Mehdi Amini <mehdi.amini at apple.com> wrote:
>
> You may want to try adding this code (copy/pasted from llc.cpp):
>
> // Initialize targets first, so that --version shows registered targets.
> InitializeAllTargets();
>