Displaying 20 results from an estimated 1000 matches similar to: "Assembly file compilation flow"
2018 May 10
0
Assembly file compilation flow
Passing an assembly file to clang does not go through any CodeGen phases.
It operates entirely in the MC layer. No MachineFunctions will be created.
It just runs it through the MCAsmParser. Most of the setup for this is in
clang's tools/driver/cc1as_main.cpp in the function ExecuteAssembler
~Craig
On Thu, May 10, 2018 at 1:32 PM Soham Sinha via llvm-dev <
llvm-dev at lists.llvm.org>
2018 May 10
1
Assembly file compilation flow
I think a key point to understand is the MCStreamer interface, which has two implementations: one for object-file generation, and one for .s file generation. CodeGen/AsmPrinter can attach to either of these implementations. MCAsmParser will generally attach to the object-file version of MCStreamer.
--paulr
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Craig Topper via
2018 Jun 26
2
How to force an unused function declaration in clang
It does, when the function has a body. When it doesn't, it ignores
<https://godbolt.org/g/2BCvht>. The body might be provided later on in the
toolchain via linking a library.
Regards,
Soham Sinha
PhD Student, Department of Computer Science
Boston University
On Tue, Jun 26, 2018 at 10:25 AM Hans Wennborg <hans at chromium.org> wrote:
> It works for me:
>
>
2018 Jun 26
2
How to force an unused function declaration in clang
For the same reason GCC allowed the attribute. Even if I want to use/inline
a function later on in the pipeline.
Regards,
Soham Sinha
PhD Student, Department of Computer Science
Boston University
On Tue, Jun 26, 2018 at 8:30 AM mayuyu.io <admin at mayuyu.io> wrote:
> Out of curiosity, how does an unused declaration affect the emitted object
> file
>
> Zhang
>
> > 在
2018 May 05
4
How to add assembly instructions in CodeGen
Hello,
I want to add assembly instructions at certain points in a function. This
is X86 specific. So I am working in the lib/Target/X86 folder. I create a
`MachineFunctionPass` in that folder. I register it in the
X86TargetMachine.cpp in addPreEmitPass(). I use BuildMI to insert my own
assembly instructions in the MachineFunctionPass. This works and my
assembly instructions are inserted at
2018 May 07
0
How to add assembly instructions in CodeGen
One place to look might be in the MachineOutliner target hooks in X86InstrInfo and AArch64InstrInfo. The MachineOutliner runs extremely late in the pass pipeline so it might be a good place to look for some inspiration. Of course, because this is *extremely late* it might not do *exactly* what you need. (e.g, this is post-register allocation, post frame-lowering, etc.)
- Jessica
> On May 4,
2018 Jun 26
2
How to force an unused function declaration in clang
clang doesn't seem to respect __attribute__((used)) in C functions. Even if
I declare a function like the following: __attribute__((used)) void
function(), then also it doesn't declare the function in its IR file if I
don't use the function. Is there any other way to force the declaration of
"unused" function declarations with clang.
I have hacked in clang 6.0.0 in
2018 May 15
3
How to inline function from other file in IR
Hello,
How can I inline a function mentioned in other file?
I have an inline function *foo* in C source file (a.c) which is not
referenced in this file. I compile this file to a.ll (I notice that the
compiled a.ll doesn't have *foo*'s definition, probably because it was
inlined but not called anywhere)
I have another C source file b.c with function *bar*; I compile this to b.ll
I link
2018 May 07
2
How to add assembly instructions in CodeGen
Hello Dean,
I looked at the XRay Instrumentation. That's a nice engineering effort. I
am sure you had your motivation to do this in CodeGen just like I wanted to
do. I don't understand all of your code but I get the idea that you are
adjusting the alignment with explicit bytes and no-op instructions. My
problem is also very much related to yours where my stack pointer ($rsp)
alignment
2018 Jun 25
2
How to include a opt pass in clang driver
Hi Eli,
I have tried that:
static void registerMyPass(const PassManagerBuilder &,
llvm::legacy::PassManagerBase &PM) {
PM.add(new MyPass());
}
static RegisterStandardPasses
RegisterMyPass(PassManagerBuilder::EP_OptimizerLast,
registerMyPass);
It still couldn't find my pass.
Regards,
Soham Sinha
PhD Student,
2018 May 17
1
How to inline function from other file in IR
Hi Soham,
“extern inline” keyword will help in this case, with this keyword compiler is forced to keeps the definition of the function and make it available for the external usage.
Also it retains the “inlinehint” attribute on the function, with that lto inliner may make it inline.
Best,
Ashutosh
From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Mehdi AMINI via llvm-dev
2018 Jun 25
2
How to include a opt pass in clang driver
Hello,
I have written a pass for the IR and I can run it with opt -load
lib/LLVMMyPass.so -mypass -myarguments -S -o output.ll < output.bc
I have registered my pass with the following code:
static RegisterPass<MyPass>
X("mypass", "MyPass Pass (with getAnalysisUsage implemented)");
How do I include the same pass in the clang driver. I tried running the
pass:
clang
2018 May 08
0
How to add assembly instructions in CodeGen
On Tue, May 8, 2018 at 4:06 AM Soham Sinha <soham1 at bu.edu> wrote:
> Hello Dean,
> I looked at the XRay Instrumentation. That's a nice engineering effort. I
am sure you had your motivation to do this in CodeGen just like I wanted to
do. I don't understand all of your code but I get the idea that you are
adjusting the alignment with explicit bytes and no-op instructions. My
2018 May 17
0
How to inline function from other file in IR
Hi Soham,
Are you intending to use the inline keyword in order to control the
inlining optimization?
The inline keyword is not doing this, it is changing the linkage type of
the symbol and instruct the compiler to discard it if there is no call
left, and also will instruct the linker to deduplicate. For instance if
multiple file include a header that defines an inline function, this
function
2018 May 07
0
How to add assembly instructions in CodeGen
On Sun, May 6, 2018 at 7:26 AM Soham Sinha via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Hello,
> I want to add assembly instructions at certain points in a function. This
is X86 specific. So I am working in the lib/Target/X86 folder. I create a
`MachineFunctionPass` in that folder. I register it in the
X86TargetMachine.cpp in addPreEmitPass(). I use BuildMI to insert my own
2018 May 14
2
Andresen Algorithm
>
> Date: Mon, 14 May 2018 14:26:13 -0400
> From: Kenneth Adam Miller via llvm-dev <llvm-dev at lists.llvm.org>
> To: llvm-dev <llvm-dev at lists.llvm.org>
> Subject: [llvm-dev] Andresen Algorithm
> Message-ID:
> <CAK7rcp_yXA79UuLvcD6LPMQBvi9tTpOGAcuWZ
> Ux1tFKTyvuh2Q at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
2018 May 17
2
Andresen Algorithm
Actually I figured out that it is:
opt -cfl-anders-aa *.ll
But now I noticed that I need the graph that it computes, and it doesn't
seem to emit that.
On Wed, May 16, 2018 at 5:19 PM, Kenneth Adam Miller <
kennethadammiller at gmail.com> wrote:
> Is there a particular way to run a specific alias analysis that is already
> implemented on a .ll file produced by clang -S
2018 May 09
1
How to add assembly instructions in CodeGen
Hi Dean,
I looked at XRay. I also thought on the similar line to add assembly
instructions as auxiliary template code and jump on to there. However, that
may still dis-align the stack. I have to think about it. But your XRay code
does give me the courage to think about this seriously.
Thank you for your help. I also figured out that we can access certain
CodeGen's feature right from the IR
2018 May 16
0
Andresen Algorithm
Is there a particular way to run a specific alias analysis that is already
implemented on a .ll file produced by clang -S -emit-llvm?
On Mon, May 14, 2018 at 7:36 PM, Soham Sinha via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Date: Mon, 14 May 2018 14:26:13 -0400
>> From: Kenneth Adam Miller via llvm-dev <llvm-dev at lists.llvm.org>
>> To: llvm-dev <llvm-dev at
2018 May 17
0
Andresen Algorithm
Usually you need to add the -analyze option, to dump the analysis results.
On Wed, May 16, 2018 at 9:09 PM, Kenneth Adam Miller via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Actually I figured out that it is:
>
> opt -cfl-anders-aa *.ll
>
> But now I noticed that I need the graph that it computes, and it doesn't
> seem to emit that.
>
> On Wed, May 16,