mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-24 23:28:41 +00:00
IPO: Add use-list-order verifier
Add a -verify-use-list-order pass, which shuffles use-list order, writes to bitcode, reads back, and verifies that the (shuffled) order matches. - The utility functions live in lib/IR/UseListOrder.cpp. - Moved (and renamed) the command-line option to enable writing use-lists, so that this pass can return early if the use-list orders aren't being serialized. It's not clear that this pass is the right direction long-term (perhaps a separate tool instead?), but short-term it's a great way to test the use-list order prototype. I've added an XFAIL-ed testcase that I'm hoping to get working pretty quickly. This is part of PR5680. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213945 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
42
include/llvm/IR/UseListOrder.h
Normal file
42
include/llvm/IR/UseListOrder.h
Normal file
@@ -0,0 +1,42 @@
|
||||
//===- llvm/IR/UseListOrder.h - LLVM Use List Order functions ---*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file has functions to modify the use-list order and to verify that it
|
||||
// doesn't change after serialization.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_IR_USELISTORDER_H
|
||||
#define LLVM_IR_USELISTORDER_H
|
||||
|
||||
namespace llvm {
|
||||
|
||||
class Module;
|
||||
|
||||
/// \brief Whether to preserve use-list ordering.
|
||||
bool shouldPreserveBitcodeUseListOrder();
|
||||
|
||||
/// \brief Shuffle all use-lists in a module.
|
||||
///
|
||||
/// Adds \c SeedOffset to the default seed for the random number generator.
|
||||
void shuffleUseLists(Module &M, unsigned SeedOffset = 0);
|
||||
|
||||
/// \brief Verify use-list order after serializing to bitcode.
|
||||
///
|
||||
/// \return \c true if there are no errors.
|
||||
bool verifyBitcodeUseListOrder(const Module &M);
|
||||
|
||||
/// \brief Verify use-list order after serializing to assembly.
|
||||
///
|
||||
/// \return \c true if there are no errors.
|
||||
bool verifyAssemblyUseListOrder(const Module &M);
|
||||
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user