Displaying 20 results from an estimated 700 matches similar to: "[LLVMdev] strcpy optimization to i32 instead of i64 stores"
2019 May 14
2
How to change CLang struct alignment behaviour?
Hi John,
On Tue, 14 May 2019 at 17:51, Joan Lluch <joan.lluch at icloud.com> wrote:
> This problem is also shared by the MSP430 target, and it’s very easy to reproduce by just compiling the code that I posted before.
That's some good detective work; it definitely explains what you're
seeing. Since MSP430 is affected it would probably be pretty easy to
upstream an alignment-aware
2019 May 13
3
How to change CLang struct alignment behaviour?
Hi Joan,
On Mon, 13 May 2019 at 18:01, Joan Lluch <joan.lluch at icloud.com> wrote:
> After looking at it a bit further, I think this is a Clang thing. Clang issues “align 2” if the struct has at least one int (2 bytes), but also if the entire struct size is multiple of 2. For example a struct with 4 char members. In these cases the LLVM backend correctly creates word sized load/stores
2019 May 13
2
How to change CLang struct alignment behaviour?
Hi Tim,
Thanks for your reply. That’s what I was afraid of. I will try on the cfe-list as you suggest though.
The reason I want structs to be aligned/padded to 2 bytes is because my architecture only has 16 bit operations. I can read (sign and zero extended) and write (truncated) 8 bit data from/to memory, but all intermediate operations in registers are performed in 16 bit registers. This
2013 May 17
3
[LLVMdev] subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)
I can't say this is a bug it is changed behavior from before the new
attribute scheme.
This issue may appear with other attributes. (there are other attributes
that clang will now place
on each function)
If you run clang as a single pass to create a .ll and don't say
-msoft-float, it puts the attribute use-soft-float=false on every
function. (It used to be that in that case
2019 May 13
3
How to change CLang struct alignment behaviour?
I had already adjusted MaxStoresPerMemcpy to my preferred value, and this works great but for the cases where load/stores are used on non-size aligned structs the odd behaviour still happens. For my 3-char, 3-byte struct test, the memcpy replacement appears to consist on a single byte load and store of the last char (this is correct), followed by a 16 bit move of the first two chars, this is also
2010 Mar 17
2
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
I'm building tool-chain for processor without integer MUL.
So, I've defined __mulsi3 for integer multiplication (int32).
Now I've got a problem with int64 multiplication which is implemented
in libgcc2.c.
Segfualt due to infinite recursion in i64 soft multiplication
(libgcc2, __muldi3).
LLVM-GCC (for my target) misoptimizes code if -O2 is passed.
It promotes i32 multiplication to
2010 Mar 17
0
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
On Wed, Mar 17, 2010 at 1:32 PM, Sergey Yakoushkin
<sergey.yakoushkin at gmail.com> wrote:
> I'm building tool-chain for processor without integer MUL.
> So, I've defined __mulsi3 for integer multiplication (int32).
>
> Now I've got a problem with int64 multiplication which is implemented
> in libgcc2.c.
> Segfualt due to infinite recursion in i64 soft
2010 Mar 17
2
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
On Wed, Mar 17, 2010 at 3:54 PM, Eli Friedman <eli.friedman at gmail.com> wrote:
> On Wed, Mar 17, 2010 at 1:32 PM, Sergey Yakoushkin
> <sergey.yakoushkin at gmail.com> wrote:
>> I'm building tool-chain for processor without integer MUL.
>> So, I've defined __mulsi3 for integer multiplication (int32).
>>
>> Now I've got a problem with int64
2010 Mar 17
0
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
Thanks, yes, I'm facing the same issue.
Hm... seems there are no simple fixes.
I have to do one more i64 mul implementation to workaround aggressive
optimizations.
Is that correct? Is this the only way?
Can I disable only one particular pass which does this promotion from
i32 to i64 using some LLVM-GCC option?
Are there other libgcc functions affected by this optimization?
Regards,
Sergey
2010 Mar 17
0
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
> This shouldn't be necessary, IMO. If you were going to implement it,
> then the correct thing to do would be to have generic selection dag
> lowering of large multiplies, which renders the library mostly
> useless.
In fact, I would prefer to avoid custom lowering for operations on large types.
i64 will be rare in my case (embedded) and their performance is not an issue.
I need
2010 Mar 17
2
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
On Wed, Mar 17, 2010 at 4:57 PM, Sergey Yakoushkin
<sergey.yakoushkin at gmail.com> wrote:
> Thanks, yes, I'm facing the same issue.
>
> Hm... seems there are no simple fixes.
> I have to do one more i64 mul implementation to workaround aggressive
> optimizations.
> Is that correct? Is this the only way?
This shouldn't be necessary, IMO. If you were going to
2013 Jul 31
0
[LLVMdev] Help with promotion/custom handling of MUL i32 and MUL i64
Hi Dan,
If you set the node's action to "Custom", you should be able to
interfere in the type legalisation phase (before it gets promoted to a
64-bit MUL) by overriding the "ReplaceNodeResults" function.
You could either expand it to a different libcall directly there, or
replace it with a target-specific node (say XXXISD::MUL32) which
claims to take i64 types but you
2013 Jul 31
1
[LLVMdev] Help with promotion/custom handling of MUL i32 and MUL i64
Thanks Tom. I really appreciate your insight.
I'm able to use the customize to get the 64-bit to go to a subroutine and
for the 32-bit, I am generate XXXISD::MUL32. I'm not sure then what you
mean about "overriding" the ReplaceNodeResults.
For ReplaceNodeResults, I'm doing:
SDValue Res = LowerOperation(SDValue(N, 0), DAG);
for (unsigned I = 0, E =
2013 May 18
0
[LLVMdev] subtle issue with soft-float and new attribute scheme (possibly an issue with other attributes)
My understanding is that with the new attribute system we should
deprecate and eventually remove the codegen command line options.
On 17 May 2013 06:04, reed kotler <rkotler at mips.com> wrote:
> I can't say this is a bug it is changed behavior from before the new
> attribute scheme.
>
> This issue may appear with other attributes. (there are other attributes
> that clang
2013 Jul 30
0
[LLVMdev] Help with promotion/custom handling of MUL i32 and MUL i64
On Tue, Jul 30, 2013 at 01:14:16PM -0600, Dan wrote:
> I'll try to run through the scenario:
>
>
> 64-bit register type target (all registers have 64 bits).
>
> all 32-bits are getting promoted to 64-bit integers
>
> Problem:
>
> MUL on i32 is getting promoted to MUL on i64
>
> MUL on i64 is getting expanded to a library call in compiler-rt
>
>
2016 Feb 02
2
creating Intrinsic DAG Node
I'm trying to 'lower' an operation that needs to create a node in the SD
that is an intrinsic call.... what is the best way to do this?
I see in the DAGBuilder it calls 'setValue' which adds to the map
NodeMap[V] where V is the key and the passed in SDValue is the value but
I'm not sure this is a good way to do it since these are local to
SelectionDAGBuilder and the
2013 Jul 31
2
[LLVMdev] Help with promotion/custom handling of MUL i32 and MUL i64
Thanks for the information, allow maybe I can re-phrase the question or
issue.
Assume 64-bit register types, but integer is 32-bit. Already have table
generation of the 64-bit operation descriptions.
How about this modified approach?
Before type-legalization, I'd really like to move all MUL I64 to a
subroutine call of my own choice.
This would be a form of customization, but I want this
2013 Jul 30
3
[LLVMdev] Help with promotion/custom handling of MUL i32 and MUL i64
I'll try to run through the scenario:
64-bit register type target (all registers have 64 bits).
all 32-bits are getting promoted to 64-bit integers
Problem:
MUL on i32 is getting promoted to MUL on i64
MUL on i64 is getting expanded to a library call in compiler-rt
the problem is that MUL32 gets promoted and then converted into a
subroutine call because it is now type i64, even though
2012 Oct 12
2
[LLVMdev] initial selection DAG
Hi,
I wonder how the initial selection DAG is built in the backends.
>From working backends I get:
----8<-------
Initial selection DAG: BB#0 'main:'
SelectionDAG has 18 nodes:
----8<-------
>From my (not working) backend I get:
----8<-------
Initial selection DAG: BB#0 'main:'
SelectionDAG has 15 nodes:
----8<-------
I miss three nodes and I wonder what do I have
2007 Nov 25
2
[LLVMdev] Newbie: Target Lowering info.
Could anybody guide me what information do I need to know about my
target in order to provide the target lowering info to the llvm DAG
generator? We do not have any fixed registers for argument passing.
Everything including the formal and actual arguments will take part in
a global interprocedural regalloc.
Any pointers to learn about this will be a great help.
Sanjiv