Summary: LegaLegalized vector parameters, but not been added FileCheck now.
Test Plan: Legalized vector parameters
Differential Revision: http://www.tpt.com/D740
Summary:
fix addi instruction, there will be a hardware error when immediate is
negative number.
Test Plan: fix add instruction
Reviewers: zhoujing
Subscribers: zhoujing
Differential Revision: http://www.tpt.com/D722
Signed-off-by: qinfan <qinfan.wang@terapines.com>
Stack space is shared between different warps, if two warps are executing
different functions, then the access to the return address will conflict,
which will lead the warp executing faster can not find the return address,
so we would like to add a barrier instruction after the lw and before the ret,
to ensure that the warps have the same scope of the sp pointer
In our previous calling convention design, all non-kernel arguments are passed
by VGPRS or TP stack, but when the arguments point to private memory address
space, the wrong memory access instructions will be generated, because private
memory based address is scalar register
Cause there are two stacks in Ventus, we need to seperate TP stack and SP stack,
this commit just add very initial support for TP stack size calculation
we follow the following rules to insert join block and join instruction
1: Legalize all the return block
when there are one more return blocks in machine function, there must be
branches, we need to reduce return blocks number down to 1
1.1: If two return blocks have common nearest parent branch, this two blocks
need to be joined, and we add a hasBeenJoined marker for this parent
branch
1.2: after we complete 1.1 process, there maybe one more return blocks, we
need to further add join block, we recursively build dominator tree for
these return blocks, first we find the nearest common dominator branch for
two return blocks, and then get dominator tree path between dominator
and each return block, we need to check this path in which whether any
other branch blocks exists, ideally, the branch block in path should have
been joined and marked, if not, this path is illegal, these two block can
not be joined
2: Insert join instructions
2.1: we scan through the MachineBasic blocks and check what blocks to insert
join instruction, below MBB represents MachineBasic Block
2.2: The MBB must have one more predecessors and its nearest dominator must
be a VBranch
2.3: Then we analyze the the predecessor of MBB, if the predecessor
has single successor, we add a join instruction to the predecessor end,
other wise, we need to insert a join block between predecessor and MBB
We adjust the stack growing direction early months for OpenCL, in order to be
compatible with current architecture, we need to do some modification to
support vararg