From: Benjamin Kramer Date: Tue, 23 Jun 2015 14:47:36 +0000 (+0000) Subject: [BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=530a616a9d9730910d8b2f4929785175ea9ca316;p=oota-llvm.git [BranchFolding] Document why replacing HashMachineInstr with hash_code doesn't work git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240415 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp index d3d276ff0df..618266731c0 100644 --- a/lib/CodeGen/BranchFolding.cpp +++ b/lib/CodeGen/BranchFolding.cpp @@ -270,7 +270,9 @@ static unsigned HashMachineInstr(const MachineInstr *MI) { for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) { const MachineOperand &Op = MI->getOperand(i); - // Merge in bits from the operand if easy. + // Merge in bits from the operand if easy. We can't use MachineOperand's + // hash_code here because it's not deterministic and we sort by hash value + // later. unsigned OperandHash = 0; switch (Op.getType()) { case MachineOperand::MO_Register: