This hashing scheme has been useful out of tree, and I want to start experimenting with it. Specifically I want to experiment on the MIRVRegNamer, MIRCanononicalizer, and eventually the MachineOutliner. This diff is a first step, that optionally brings stable hashing to the MIRVRegNamer (and as a result, the MIRCanonicalizer). We've tested this hashing scheme on a lot of MachineOperand types that llvm::hash_value can not handle in a stable manner. This stable hashing was also the basis for "Global Machine Outliner for ThinLTO" in EuroLLVM 2020 http://llvm.org/devmtg/2020-04/talks.html#TechTalk_58 Credits: Kyungwoo Lee, Nikolai Tillmann Differential Revision: https://reviews.llvm.org/D86952
54 lines
2.4 KiB
YAML
54 lines
2.4 KiB
YAML
# RUN: llc -mtriple=arm64-apple-ios11.0.0 -o - -verify-machineinstrs -run-pass mir-canonicalizer %s | FileCheck %s
|
|
# RUN: llc -mtriple=arm64-apple-ios11.0.0 -o - -verify-machineinstrs -mir-vreg-namer-use-stable-hash -run-pass mir-canonicalizer %s | FileCheck %s
|
|
|
|
...
|
|
---
|
|
name: Proc8
|
|
stack:
|
|
- { id: 0, type: default, offset: 0, size: 4, alignment: 4,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -4, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
- { id: 1, type: default, offset: 0, size: 8, alignment: 8,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -16, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
- { id: 2, type: default, offset: 0, size: 8, alignment: 8,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -24, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
- { id: 3, type: default, offset: 0, size: 8, alignment: 8,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -32, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
- { id: 4, type: default, offset: 0, size: 8, alignment: 8,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -40, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
- { id: 5, type: default, offset: 0, size: 8, alignment: 8,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -48, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
- { id: 6, type: default, offset: 0, size: 8, alignment: 8,
|
|
stack-id: default, callee-saved-register: '', callee-saved-restored: true,
|
|
local-offset: -56, debug-info-variable: '', debug-info-expression: '',
|
|
debug-info-location: '' }
|
|
constants:
|
|
body: |
|
|
bb.0:
|
|
liveins: $x0, $x1, $d0, $d1
|
|
|
|
%42:gpr32 = LDRWui %stack.0, 0 :: (dereferenceable load 8)
|
|
|
|
;CHECK: %bb0_{{[0-9]+}}__1:gpr32 = LDRWui %stack.0, 0 :: (dereferenceable load 8)
|
|
;CHECK-NEXT: $w0 = COPY %bb0_
|
|
;CHECK-NEXT: RET_ReallyLR implicit $w0
|
|
|
|
%vreg1234:gpr32 = COPY %42
|
|
%vreg1235:gpr32 = COPY %vreg1234
|
|
%vreg1236:gpr32 = COPY %vreg1235
|
|
$w0 = COPY %vreg1236
|
|
RET_ReallyLR implicit $w0
|
|
|
|
...
|