Commit Graph

50192 Commits

Author SHA1 Message Date
Christoph Bumiller e43a3a66a9 nv50/ir: rewrite the register allocator as GCRA, with spilling
This is more flexible than the linear scan, and we don't need the
separate allocation pass for constrained values anymore.
2012-04-14 21:54:03 +02:00
Christoph Bumiller 99319328d4 nv50/ir/tgsi: only export x-component of PSIZE 2012-04-14 21:54:03 +02:00
Christoph Bumiller 12a2f5121d nvc0: fix emission of 3rd src in SET_AND,OR,XOR 2012-04-14 21:54:03 +02:00
Francisco Jerez f01efba60a nv50/ir: Fix BuildUtil::mkSelect and mkClobber 2012-04-14 21:54:03 +02:00
Christoph Bumiller 054fab5b48 nv50/ir: fix reg file conflicts with undefined-value placeholders 2012-04-14 21:54:03 +02:00
Christoph Bumiller 51327a2df2 nv50/ir/opt: silence warning (int < Elements() signedness) 2012-04-14 21:54:03 +02:00
Christoph Bumiller ef7f9f68cf nv50/ir/opt: fix combineSt access to wrong instruction 2012-04-14 21:54:03 +02:00
Christoph Bumiller bb9c15bac4 nv50/ir/opt: another insn NULL check in phi elimination 2012-04-14 21:54:03 +02:00
Francisco Jerez 4ece0dbd2f nv50/ir/ssa: Take into account function inputs and outputs. 2012-04-14 21:54:02 +02:00
Francisco Jerez 4a44f94caf nv50/ir: Clean up before calculating instruction ordering for a new function. 2012-04-14 21:54:02 +02:00
Francisco Jerez a539785187 nv50/ir/ra: Allocate registers for function arguments. 2012-04-14 21:54:02 +02:00
Francisco Jerez 530ff61ba7 nv50/ir: Take into account function args in the live range calculation code. 2012-04-14 21:54:02 +02:00
Francisco Jerez ed255dbae2 nv50/ir/ra: Use matching physical regs for function args in caller and callee. 2012-04-14 21:54:02 +02:00
Francisco Jerez a3dd45e1c2 nv50/ir/tgsi: Infer function inputs/outputs.
Edit: Don't do it for the main function of (graphics) shaders,
its inputs and outputs always go through TGSI_FILE_INPUT/OUTPUT.
This prevents all TEMPs from counting as live out and reduces
register pressure.
2012-04-14 21:54:02 +02:00
Francisco Jerez 9bb36d54a2 nv50/ir/tgsi: Replace the inlining logic with proper function calls. 2012-04-14 21:54:02 +02:00
Francisco Jerez 56d40aa51b nv50/ir: Decouple DataArray from the dictionary that maps locations to values.
The point is to keep an independent dictionary for each function.

The array that was being used as dictionary has been converted into a
"bimap" for two different reasons: first, because having an almost
empty instance of an array with as many entries as registers there are
in the program, once for every function, would be wasteful, and
second, because we want to be able to map Value pointers back to
locations at some point.
2012-04-14 21:54:02 +02:00
Christoph Bumiller d41f293bf0 nv50/ir/opt: don't delete instruction in removeFlow before its last use 2012-04-14 21:54:02 +02:00
Christoph Bumiller be161e66d6 nv50/ir/opt: check BB equality before instruction ordering in CSE 2012-04-14 21:54:02 +02:00
Christoph Bumiller 44e84d6f16 nv50/ir/opt: don't copy-propagate cond MOVs or MOVs to other reg files
We've never encountered the latter on nvc0, but on nv50 we have moves
between GPRs and address regs.
2012-04-14 21:54:02 +02:00
Christoph Bumiller ca1fc2b864 nv50/ir/opt: don't replace conditional definitions in CSE 2012-04-14 21:54:02 +02:00
Francisco Jerez 90f0fac655 nv50/ir/opt: Update the symbol size when combining loads and stores. 2012-04-14 21:54:02 +02:00
Christoph Bumiller 5df92c81c3 nv50/ir: initialize FlowInstruction::builtin 2012-04-14 21:54:01 +02:00
Francisco Jerez 1e95794173 nv50/ir/opt: Fix for function calls. 2012-04-14 21:54:01 +02:00
Francisco Jerez 98116cc3dc nv50/ir: Build a "symbol" table with the binary offsets of each function. 2012-04-14 21:54:01 +02:00
Francisco Jerez 5e4b2a1a47 nv50/ir: Add support for removing functions from a program. 2012-04-14 21:54:01 +02:00
Francisco Jerez d32ebb8c30 nv50/ir: Scan program functions in DFS-postorder.
The reason is that several passes (regalloc, function argument
binding, inlining) are going to require the callees of a function to
be processed before the caller.
2012-04-14 21:54:01 +02:00
Francisco Jerez 78de8c8ab5 nv50/ir: Deal with graph iterators using RAII. 2012-04-14 21:54:01 +02:00
Francisco Jerez 898b0981b6 nv50/ir: Add convenience method for calculating the live sets of a function. 2012-04-14 21:54:01 +02:00
Francisco Jerez 3e9150cd96 nv50/ir: Add support code for calculating the clobber set of a BB or function. 2012-04-14 21:54:01 +02:00
Francisco Jerez d6d1f0e4a2 nv50/ir/opt: Don't lose modifiers during constant folding. 2012-04-14 21:54:01 +02:00
Francisco Jerez 14d5f975a6 nv50/ir/opt: Improve modifier handling. 2012-04-14 21:54:01 +02:00
Francisco Jerez 784848a94d nv50/ir: Add support for cloning FlowInsns, ImmediateVals and BBs. 2012-04-14 21:54:01 +02:00
Francisco Jerez a05e6a3fa2 nv50/ir: Decouple object cloning logic from the sub-object recursion policy. 2012-04-14 21:54:01 +02:00
Francisco Jerez da28ba00d8 nv50/ir: Make sure that several IR objects are destroyed on takedown. 2012-04-14 21:54:01 +02:00
Christoph Bumiller 9362d4bc0a nv50/ir: make Instruction::src/def container private 2012-04-14 21:54:00 +02:00
Francisco Jerez 8cc2eca5df nv50/ir: Add support for unlimited instruction arguments. 2012-04-14 21:54:00 +02:00
Christoph Bumiller 15d224f7a7 nv50/ir: temporarily exclude nv50 code emitter from build
It's not used yet and shouldn't have been included in the first
place.
2012-04-14 21:54:00 +02:00
Christoph Bumiller f113b6f959 nv50/ir: copy value size in SSA-rename pass 2012-04-14 21:54:00 +02:00
Christoph Bumiller 55f9bdb64e nv50/ir/opt: improve post-multiply and check target for support 2012-04-14 21:54:00 +02:00
Christoph Bumiller 56cf2da022 nv50/ir: add setFlagsDef/Src helper
Will be used by nv50 target.
2012-04-14 21:54:00 +02:00
Christoph Bumiller 286abcb51e nv50/ir: add isAccessSupported check for memory access coalescing 2012-04-14 21:54:00 +02:00
Christoph Bumiller c04d6d95e0 nv50/ir: add function for splitting a BasicBlock
Fixes to initial implementation by Francisco Jerez.
2012-04-14 21:54:00 +02:00
Francisco Jerez 0056e1b988 nv50/ir: Allow attaching two nodes when either one is already inside the graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez 099b81396e nv50/ir: Allow inserting isolated nodes to a graph. 2012-04-14 21:54:00 +02:00
Francisco Jerez 1829484458 nv50/ir: Fix memory corruption in Function::orderInstructions().
"iter" doesn't reference a BasicBlock directly, but a Node::Graph,
i.e. BasicBlock::get() is casting to the wrong pointer type.
2012-04-14 21:54:00 +02:00
Francisco Jerez ab382fbc35 nv50/ir: Fix up insertion of PHI instructions using bb->insertHead(). 2012-04-14 21:54:00 +02:00
Christoph Bumiller fc740e7924 nv50/ir: fix insertHead and remove for BBs with PHI ops only 2012-04-14 21:54:00 +02:00
Francisco Jerez 349cb60ed5 nv50/ir: Don't crash on zero sized BitSets. 2012-04-14 21:54:00 +02:00
Francisco Jerez f0a7ec9a2f nv50/ir: Fix Interval::clear(). 2012-04-14 21:53:59 +02:00
Christoph Bumiller cd6d63fa60 nv50/ir/tgsi: handle inferSrcType(NOT) to be u32 2012-04-14 21:53:59 +02:00