summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2019-12-04 15:36:35 -0800
committerQuentin Colombet <qcolombet@apple.com>2019-12-05 16:32:30 -0800
commit2ec71ea7c74df20983031c6e1be07b14da0e9109 (patch)
treed2ffa82f53a4ff0c689e865ec60fd5847f92bef1 /lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
parent1f822f212cde1ad9099cf45af0652a83380de772 (diff)
downloadbcm5719-llvm-2ec71ea7c74df20983031c6e1be07b14da0e9109.tar.gz
bcm5719-llvm-2ec71ea7c74df20983031c6e1be07b14da0e9109.zip
[RegisterCoalescer] Fix the creation of subranges when rematerialization is used
* Context * During register coalescing, we use rematerialization when coalescing is not possible. That means we may rematerialize a super register when only a smaller register is actually used. E.g., 0B v1 = ldimm 0xFF 1B v2 = COPY v1.low8bits 2B = v2 => 0B v1 = ldimm 0xFF 1B v2 = ldimm 0xFF 2B = v2.low8bits Where xB are the slot indexes. Here v2 grew from a 8-bit register to a 16-bit register. When that happens and subregister liveness is enabled, we create subranges for the newly created value. E.g., before remat, the live range of v2 looked like: main range: [1r, 2r) (Reads v2 is defined at index 1 slot register and used before the slot register of index 2) After remat, it should look like: main range: [1r, 2r) low 8 bits: [1r, 2r) high 8 bits: [1r, 1d) <-- dead def I.e., the unsused lanes of v2 should be marked as dead definition. * The Problem * Prior to this patch, the live-ranges from the previous exampel, would have the full live-range for all subranges: main range: [1r, 2r) low 8 bits: [1r, 2r) high 8 bits: [1r, 2r) <-- too long * The Fix * Technically, the code that this patch changes is not wrong: When we create the subranges for the newly rematerialized value, we create only one subrange for the whole bit mask. In other words, at this point v2 live-range looks like this: main range: [1r, 2r) low & high: [1r, 2r) Then, it gets wrong when we call LiveInterval::refineSubRanges on low 8 bits: main range: [1r, 2r) low 8 bits: [1r, 2r) high 8 bits: [1r, 2r) <-- too long Ideally, we would like LiveInterval::refineSubRanges to be able to do the right thing and mark the dead lanes as such. However, this is not possible, because by the time we update / refine the live ranges, the IR hasn't been updated yet, therefore we actually don't have enough information to do the right thing. Another option to fix the problem would have been to call LiveIntervals::shrinkToUses after the IR is updated. This is not desirable as this may have a noticeable impact on compile time. Instead, what this patch does is when we create the subranges for the rematerialized value, we explicitly create one subrange for the lanes that were used before rematerialization and one for the lanes that were not used. The used one inherits the live range of the main range and the unused one is just created empty. The existing rematerialization code then detects that the unused one are not live and it correctly sets dead def intervals for them. https://llvm.org/PR41372
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud