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
16 lines
569 B
YAML
16 lines
569 B
YAML
# RUN: llc -run-pass mir-canonicalizer -verify-machineinstrs -o - %s | FileCheck %s
|
|
# RUN: llc -run-pass mir-canonicalizer -mir-vreg-namer-use-stable-hash -verify-machineinstrs -o - %s | FileCheck %s
|
|
---
|
|
name: cimm_fpimm_hash_test
|
|
body: |
|
|
bb.0:
|
|
; CHECK: _1:_(s1) = G_CONSTANT i1 true
|
|
; CHECK: _1:_(s1) = G_CONSTANT i1 false
|
|
; CHECK: _1:_(s32) = G_FCONSTANT float
|
|
; CHECK: _1:_(s32) = G_FCONSTANT float
|
|
%0:_(s1) = G_CONSTANT i1 true
|
|
%1:_(s1) = G_CONSTANT i1 false
|
|
%2:_(s32) = G_FCONSTANT float 1.0
|
|
%3:_(s32) = G_FCONSTANT float 0.0
|
|
...
|