mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
de3532220a
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
22 lines
784 B
YAML
22 lines
784 B
YAML
# RUN: llc -o - -run-pass mir-canonicalizer -verify-machineinstrs %s | FileCheck %s
|
|
# RUN: llc -o - -run-pass mir-canonicalizer -mir-vreg-namer-use-stable-hash -verify-machineinstrs %s | FileCheck %s
|
|
--- |
|
|
target triple = "aarch64-unknown-unknown"
|
|
define void @f() { unreachable }
|
|
...
|
|
---
|
|
name: f
|
|
constants:
|
|
- id: 0
|
|
value: '<1 x i8> <i8 0>'
|
|
- id: 1
|
|
value: '<1 x i8> <i8 1>'
|
|
body: |
|
|
bb.0:
|
|
; Test that we no longer have hash collisions between two different consts:
|
|
;CHECK: %bb{{[0-9]+}}_{{[0-9]+}}__1:gpr64common = ADR
|
|
;CHECK: %bb{{[0-9]+}}_{{[0-9]+}}__1:gpr64common = ADR
|
|
%vreg0:gpr64common = ADRP target-flags(aarch64-page) %const.0
|
|
%vreg1:gpr64common = ADRP target-flags(aarch64-page) %const.1
|
|
...
|