search for: hash_combine

Displaying 14 results from an estimated 14 matches for "hash_combine".

2012 Oct 29
3
[LLVMdev] [llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp
...runk/lib/CodeGen/MachineInstr.cpp (original) > +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Aug 28 13:05:48 2012 > @@ -208,8 +208,8 @@ > hash_code llvm::hash_value(const MachineOperand &MO) { > switch (MO.getType()) { > case MachineOperand::MO_Register: > - return hash_combine(MO.getType(), MO.getTargetFlags(), > MO.getReg(), > - MO.getSubReg(), MO.isDef()); > + // Register operands don't have target flags. > + return hash_combine(MO.getType(), MO.getReg(), MO.getSubReg(), > + MO.isDef()); > case MachineOperand::MO_Im...
2014 Feb 03
6
[LLVMdev] ADT/Hashing.h on 32-bit platforms
...; platforms and the inputs consistent. I've attached a patch that makes the hashing implementation consistently use a 64-bit seed everywhere. With this change the implementation should produce the same hash codes modulo SIZE_MAX + 1 for identical values independent of the platform. (Though hash_combine may still produce different results if the size of an argument type differs between platforms). I suspect the negative performance impact on 32-bit platforms should be small, but I didn't do any benchmarking. With atomics one could probably replace the thread safe local static in get_execu...
2012 Oct 29
0
[LLVMdev] [llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp
...Instr.cpp (original) >> +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Aug 28 13:05:48 2012 >> @@ -208,8 +208,8 @@ >> hash_code llvm::hash_value(const MachineOperand &MO) { >> switch (MO.getType()) { >> case MachineOperand::MO_Register: >> - return hash_combine(MO.getType(), MO.getTargetFlags(), >> MO.getReg(), >> - MO.getSubReg(), MO.isDef()); >> + // Register operands don't have target flags. >> + return hash_combine(MO.getType(), MO.getReg(), MO.getSubReg(), >> + MO.isDef()); >> ca...
2012 Oct 29
2
[LLVMdev] [llvm-commits] [llvm] r162770 - in /llvm/trunk: include/llvm/CodeGen/MachineOperand.h lib/CodeGen/MachineInstr.cpp
...> +++ llvm/trunk/lib/CodeGen/MachineInstr.cpp Tue Aug 28 13:05:48 2012 > >> @@ -208,8 +208,8 @@ > >> hash_code llvm::hash_value(const MachineOperand &MO) { > >> switch (MO.getType()) { > >> case MachineOperand::MO_Register: > >> - return hash_combine(MO.getType(), MO.getTargetFlags(), > >> MO.getReg(), > >> - MO.getSubReg(), MO.isDef()); > >> + // Register operands don't have target flags. > >> + return hash_combine(MO.getType(), MO.getReg(), MO.getSubReg(), > >> + MO...
2014 Feb 01
2
[LLVMdev] ADT/Hashing.h on 32-bit platforms
Hi, Currently the hashing implementation in ADT/Hashing.h produces hash values on 32-bit platforms that differ from the lower 32-bits of the hash values produced on 64-bit platforms. It seems the only reason for this difference is that the uint64_t integer seed is truncated to size_t. Since the usage of uint64_t and size_t as types for seed values in the implementation is somewhat
2014 Jun 04
2
[LLVMdev] Lots of regtest failures on PPC64/Linux
...[==========] Running 1 test from 1 test case. > [ 1314s] [----------] Global test environment set-up. > [ 1314s] [----------] 1 test from HashingTest > [ 1314s] [ RUN ] HashingTest.HashCombineBasicTest > [ 1314s] ../unittests/ADT/HashingTest.cpp:413: Failure > [ 1314s] Value of: hash_combine(bigarr[0], bigarr[1], l3) > [ 1314s] Actual: 5088237075164901046 > [ 1314s] Expected: hash_combine_range(bigarr, bigarr + 10) > [ 1314s] Which is: 16538947639308476466 > [ 1314s] [ FAILED ] HashingTest.HashCombineBasicTest (0 ms) > [ 1314s] [----------] 1 test from HashingTest (0...
2014 May 12
2
[LLVMdev] Lots of regtest failures on PPC64/Linux
----- Original Message ----- > From: "İsmail Dönmez" <ismail at donmez.ws> > To: "Hal Finkel" <hfinkel at anl.gov> > Cc: "LLVM Developers Mailing List" <llvmdev at cs.uiuc.edu> > Sent: Monday, May 12, 2014 7:18:48 AM > Subject: Re: Lots of regtest failures on PPC64/Linux > > > Hi Hal, > > > > > > On
2012 Feb 29
1
[LLVMdev] Proposed implementation of N3333 hashing interfaces for LLVM (and possible libc++)
...igned to be overloaded for each > // user-defined type which wishes to be used within a hashing context. It > // should be overloaded within the user-defined type's namespace and found via > // ADL. Overloads for primitive types are provided by this library. > // > // -- 'hash_combine' and 'hash_combine_range' are functions designed to aid > // programmers in easily and intuitively combining a set of data into a single > // hash_code for their object. They should only logically be used within the > // implementation of a 'hash_value' routine or si...
2017 Jul 31
3
[RFC] Profile guided section layout
Hi Rafael, On 07/31/2017 04:20 PM, Rafael Avila de Espindola via llvm-dev wrote: > However, do we need to start with instrumentation? The original paper > uses sampling with good results and current intel cpus can record every > branch in a program. > > I would propose starting with just an lld patch that reads the call > graph from a file. The format would be very similar to
2012 Feb 29
0
[LLVMdev] Proposed implementation of N3333 hashing interfaces for LLVM (and possible libc++)
Thanks for the feedback thus far! I've updated the header file, and enclosed a complete patch against LLVM. This passes all the regtests, and I'll be doing more thorough testing of LLVM itself with the patch. I've included some basic unit tests, but could probably do more here... Not sure it's worth delaying the initial submission though, as the best testing is to use a hash
2017 Jul 31
2
[RFC] Profile guided section layout
...+ struct Edge { + NodeIndex From; + NodeIndex To; + mutable uint64_t Weight; + bool operator==(const Edge Other) const { + return From == Other.From && To == Other.To; + } + }; + + struct EdgeHash { + std::size_t operator()(const Edge E) const { + return llvm::hash_combine(E.From, E.To); + }; + }; + + std::vector<Node> Nodes; + std::unordered_set<Edge, EdgeHash> Edges; + + auto InsertOrIncrementEdge = [](std::unordered_set<Edge, EdgeHash> &Edges, + const Edge E) { + if (E.From == E.To) + return; +...
2017 Jun 15
7
[RFC] Profile guided section layout
...+ struct Edge { + NodeIndex From; + NodeIndex To; + mutable uint64_t Weight; + bool operator==(const Edge Other) const { + return From == Other.From && To == Other.To; + } + }; + + struct EdgeHash { + std::size_t operator()(const Edge E) const { + return llvm::hash_combine(E.From, E.To); + }; + }; + + std::vector<Node> Nodes; + std::unordered_set<Edge, EdgeHash> Edges; + + auto InsertOrIncrementEdge = [](std::unordered_set<Edge, EdgeHash> &Edges, + const Edge E) { + if (E.From == E.To) + return; +...
2012 Feb 28
9
[LLVMdev] Proposed implementation of N3333 hashing interfaces for LLVM (and possible libc++)
Hello folks, TL;DR: This is my proposed hashing interface based on a proposed standard hashing interface. It also is implemented with a much faster and higher quality algorithm than the current one. This is an *early draft* of the code, looking for initial feedback. There has been recent interest in improving the quality and consistency of LLVM's approach to hashing. In particular, getting
2017 Aug 01
2
[RFC] Profile guided section layout
...+ struct Edge { + NodeIndex From; + NodeIndex To; + mutable uint64_t Weight; + bool operator==(const Edge Other) const { + return From == Other.From && To == Other.To; + } + }; + + struct EdgeHash { + std::size_t operator()(const Edge E) const { + return llvm::hash_combine(E.From, E.To); + }; + }; + + std::vector<Node> Nodes; + std::unordered_set<Edge, EdgeHash> Edges; + + auto InsertOrIncrementEdge = [](std::unordered_set<Edge, EdgeHash> &Edges, + const Edge E) { + if (E.From == E.To) + return; +...