Displaying 20 results from an estimated 1000 matches similar to: "Unaligned atomic load/store"
2017 May 22
2
How exactly is datatype alignment determined?
On Mon, 22 May 2017, Dr. ERDI Gergo wrote:
> Actually, tracking down the sequence of function calls, it turns out that '8'
> is ultimately coming from the following call in DataLayout::getAlignment:
>
> getAlignmentInfo(AGGREGATE_ALIGN, 0, abi_or_pref, Ty);
>
> this seems to return 8 with the following datalayout string:
>
>
2017 May 22
2
How exactly is datatype alignment determined?
The 8 in the data layout string should have been converted to a byte value
by this code before it was passed to setAlignment. As far as I cant ell
getAlignment should return the byte alignment that was passed to
setAlignment, not the bit alignment from the string.
// ABI alignment.
if (Rest.empty())
report_fatal_error(
"Missing alignment specification in
2017 May 22
2
How exactly is datatype alignment determined?
On Mon, 22 May 2017, Krzysztof Parzyszek via llvm-dev wrote:
> Probably from LargeArrayMinWidth/LargeArrayAlign settings in Targets.cpp (in
> clang).
Wait what? In clang? But my input is already LLVM IR.
MF->getDataLayout().getPrefTypeAlignment(Ty) must be basing its answer on
either something in the IR file, or in the target implementation, but
clang is not really in the picture.
2017 May 09
3
Instruction selection for 'load' based on static vs. dynamic data
On Tue, 9 May 2017, Krzysztof Parzyszek wrote:
> def: Pat<(ld (add (WRAPPER RC:$addr), (sign_extend RC:$offset))),
> (load_instruction_rr RC:$addr, RC:$offset)>;
>
> Where "load_instruction" is a machine load instruction with base address and
> an offset, both in registers, and RC is the corresponding register class.
Can I also use something more complex
2017 May 30
2
Pseudo-instruction that overwrites its input register
On Tue, 30 May 2017, Nemanja Ivanovic wrote:
> This is typically accomplished with something like PPC's `RegConstraint` and
> `NoEncode`. You can see examples of it that are very similar to what you're after in
> PPC's load/store with update forms (i.e. load a value and update the base register
> with the effective address - these are used for pre-increment loads/stores).
2017 May 30
1
Pseudo-instruction that overwrites its input register
The reason the ones in PPCInstrInfo.td don't have the patterns to match is
the reason they are more analogous to your problem. Namely, tblgen does not
have a way to produce nodes with more than one result. The load-with-update
instructions do exactly that - one of the inputs is also an output, but the
other output is independent (and necessarily a separate register). The FMA
variants have
2017 May 07
3
Instruction selection for 'load' based on static vs. dynamic data
Hi,
I've been looking at the new AVR backend lately, and one issue I've
found is that all 'load' IR instructions are matched using the 'ld'
AVR instruction, including 'load's for lookup tables generated from
switches.
On the AVR architecture, RAM and the program image are in completely
separated namespaces. There's a distinct 'lpm' (Load from Program
2017 May 22
2
How exactly is datatype alignment determined?
Hi,
I'm seeing a bug in the AVR backend that seems to be caused by LLVM
thinking things will be aligned to 8 bytes whereas they are unaligned.
Specifically, MF->getDataLayout().getPrefTypeAlignment(Ty) returns 8 for
the following two types:
%opt = type { i8, [0 x i8], [3 x i8] }
%Machine = type { i16, [0 x i8], i16, [0 x i8], [16 x i8], [0 x i8] }
The target datalayout specifies that
2017 Jul 29
2
ISelDAGToDAG breaks node ordering
Hi,
During instruction selection, I have the following code for certain LOAD
instructions:
const LoadSDNode *LD = cast<LoadSDNode>(N);
SDNode* LDW = CurDAG->getMachineNode(AVR::LDWRdPtr, SDLoc(N), VT,
PtrVT, MVT::Other,
LD->getBasePtr(), LD->getChain());
// Honestly, I have no idea what this does, but other memory
// accessing instructions
2017 May 28
2
Pseudo-instruction that overwrites its input register
Hi,
I'd like to define a pseudo-instruction whose expansion will, as a
side-effect, overwrite an input register's value: the pseudo-instruction
ldw r1:r2, P
to load 2 bytes from memory address P is to be expaneded to
ld r1, P+
ld r2, P
where "ld _, P+" is an instruction that loads a single byte from P, and
post-increments P by one.
How can I represent this behaviour in
2017 May 09
2
Instruction selection for 'load' based on static vs. dynamic data
On Mon, 8 May 2017, Krzysztof Parzyszek via llvm-dev wrote:
> You can create the differentiation between objects in the data memory and in
> the program memory in LowerGlobalAddress (e.g. you can create different ISD
> opcodes that generate these addresses) and then use those to select
> corresponding instructions.
Right, which is how I also understand Zhai Xiang's suggestion
2017 May 28
2
Pseudo-instruction that overwrites its input register
On Sun, 28 May 2017, David Chisnall wrote:
>> let Constraints = "@earlyclobber $reg" in
>> def LDWRdPtr : Pseudo<(outs DREGS:$reg),
>> (ins PTRREGS:$ptrreg),
>> "ldw\t$reg, $ptrreg",
>> [(set i16:$reg, (load i16:$ptrreg))]>,
>>
2017 Jul 31
0
ISelDAGToDAG breaks node ordering
On 7/29/2017 1:28 AM, Dr. ERDI Gergo via llvm-dev wrote:
> Hi,
>
> During instruction selection, I have the following code for certain
> LOAD instructions:
>
> const LoadSDNode *LD = cast<LoadSDNode>(N);
> SDNode* LDW = CurDAG->getMachineNode(AVR::LDWRdPtr, SDLoc(N),
> VT, PtrVT, MVT::Other,
> LD->getBasePtr(), LD->getChain());
>
2009 May 21
0
[LLVMdev] [PATCH] Add new phase to legalization to handle vector operations
On Wed, May 20, 2009 at 4:55 PM, Dan Gohman <gohman at apple.com> wrote:
> Can you explain why you chose the approach of using a new pass?
> I pictured removing LegalizeDAG's type legalization code would
> mostly consist of finding all the places that use TLI.getTypeAction
> and just deleting code for handling its Expand and Promote. Are you
> anticipating something more
2009 May 20
2
[LLVMdev] [PATCH] Add new phase to legalization to handle vector operations
On May 20, 2009, at 1:34 PM, Eli Friedman wrote:
> On Wed, May 20, 2009 at 1:19 PM, Eli Friedman
> <eli.friedman at gmail.com> wrote:
>
>> Per subject, this patch adding an additional pass to handle vector
>>
>> operations; the idea is that this allows removing the code from
>>
>> LegalizeDAG that handles illegal types, which should be a significant
2009 Dec 22
2
[LLVMdev] LegalizeDAG Error?
The LegalizeDAG.cpp file has this code in SelectionDAGLegalize::PromoteNode:
case ISD::BSWAP: {
unsigned DiffBits = NVT.getSizeInBits() - OVT.getSizeInBits();
Tmp1 = DAG.getNode(ISD::ZERO_EXTEND, dl, NVT, Tmp1);
Tmp1 = DAG.getNode(ISD::BSWAP, dl, NVT, Tmp1);
Tmp1 = DAG.getNode(ISD::SRL, dl, NVT, Tmp1,
DAG.getConstant(DiffBits, TLI.getShiftAmountTy()));
2010 Mar 15
1
[LLVMdev] SelectionDAG constant folding leads to assertion failure
My experimental code calls DAG.getNode to construct a unary node with
a flag result. Unfortunately the argument turns out to be constant, so
lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2332 calls VT.getSizeInBits
on the flag type, which isSimple(), so we call V.getSizeInBits at
ValueTypes.h:560 and fail at ValueTypes.h:240:
clang: .../include/llvm/CodeGen/ValueTypes.h:240: unsigned int
2015 May 12
2
[LLVMdev] i1 types in MergeConsecutiveStores
Hello LLVM,
In DAGCombiner.cpp, MergeConsecutiveStores uses
int64_t ElementSizeBytes = MemVT.getSizeInBits()/8;
https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L10669
which is broken for i1 types where getSizeInBits() == 1. My
out-of-tree target hits this case and eventually LLVM asserts in
Type.cpp.
Is there some reason MergeConsecutiveStores should
2010 Feb 04
2
[LLVMdev] Integrated instruction scheduling/register allocation
A more pressing need is a pre-regalloc scheduler that can switch modes to balance reducing latency vs. reducing register pressure.
The problem is the current approach is the scheduler is locked into one mode or the other. For x86, it generally makes sense to schedule for low register pressure. That is, until you are dealing with a block that are explicitly SSE code in 64-bit mode. In that case,
2012 Jul 27
2
[LLVMdev] TLI.getSetCCResultType() and/or MVT broken by design?
I'm running into lots of problems with this call back. Mostly the problem occurs because this callback is used before types are legalized. However, the code generator does not have a 1-1 correspondence between all LLVM types and the codegen types. This leads to problems when getSetCCResultType is passed in an invalid type, but has a valid LLVM type attached to it. An example is <3 x