Commit c5bc5cb3 by John Porto

Subzero. Flags refactoring.

BUG= R=stichnot@chromium.org Review URL: https://codereview.chromium.org/1803403002 .
parent 4c16ac0f
......@@ -166,14 +166,13 @@ void BrowserCompileServer::getParsedFlags(uint32_t NumThreads, int argc,
char **argv) {
ClFlags::parseFlags(argc, argv);
ClFlags::getParsedClFlags(*Flags);
ClFlags::getParsedClFlagsExtra(*ExtraFlags);
// Set some defaults which aren't specified via the argv string.
Flags->setNumTranslationThreads(NumThreads);
Flags->setUseSandboxing(true);
Flags->setOutFileType(FT_Elf);
Flags->setTargetArch(getTargetArch());
ExtraFlags->setBuildOnRead(true);
ExtraFlags->setInputFileFormat(llvm::PNaClFormat);
Flags->setBuildOnRead(true);
Flags->setInputFileFormat(llvm::PNaClFormat);
}
bool BrowserCompileServer::pushInputBytes(const void *Data, size_t NumBytes) {
......@@ -220,7 +219,7 @@ void BrowserCompileServer::startCompileThread(int ObjFD) {
CompileThread = std::thread([this]() {
llvm::install_fatal_error_handler(fatalErrorHandler, this);
Ctx->initParserThread();
this->getCompiler().run(*ExtraFlags, *Ctx.get(),
this->getCompiler().run(*Flags, *Ctx.get(),
// Retain original reference, but the compiler
// (LLVM's MemoryObject) wants to handle deletion.
std::unique_ptr<llvm::DataStreamer>(InputStream));
......
......@@ -16,7 +16,6 @@
#define SUBZERO_SRC_ICEBROWSERCOMPILESERVER_H
#include "IceClFlags.h"
#include "IceClFlagsExtra.h"
#include "IceCompileServer.h"
#include "IceDefs.h"
#include "IceELFStreamer.h"
......@@ -42,9 +41,7 @@ class BrowserCompileServer : public CompileServer {
class StringStream;
public:
BrowserCompileServer()
: Flags(&GlobalContext::Flags), ExtraFlags(&GlobalContext::ExtraFlags),
HadError(false) {}
BrowserCompileServer() : Flags(&GlobalContext::Flags), HadError(false) {}
~BrowserCompileServer() final;
......@@ -105,7 +102,6 @@ private:
std::unique_ptr<StringStream> ErrorStream;
std::unique_ptr<ELFStreamer> ELFStream;
ClFlags *Flags;
ClFlagsExtra *ExtraFlags;
std::thread CompileThread;
std::atomic<bool> HadError;
};
......
......@@ -441,7 +441,7 @@ void getRandomPostOrder(CfgNode *Node, BitVector &ToVisit,
} // end of anonymous namespace
void Cfg::shuffleNodes() {
if (!Ctx->getFlags().shouldReorderBasicBlocks())
if (!Ctx->getFlags().getReorderBasicBlocks())
return;
NodeList ReversedReachable;
......@@ -764,7 +764,7 @@ void Cfg::doAddressOpt() {
}
void Cfg::doNopInsertion() {
if (!Ctx->getFlags().shouldDoNopInsertion())
if (!Ctx->getFlags().getShouldDoNopInsertion())
return;
TimerMarker T(TimerStack::TT_doNopInsertion, this);
RandomNumberGenerator RNG(Ctx->getFlags().getRandomSeed(), RPE_NopInsertion,
......
//===- subzero/src/IceClFlagsExtra.h - Extra Cl Flags -----------*- C++ -*-===//
//
// The Subzero Code Generator
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
///
/// \file
/// \brief Defines class Ice::ClFlagsExtra
///
//===----------------------------------------------------------------------===//
#ifndef SUBZERO_SRC_ICECLFLAGSEXTRA_H
#define SUBZERO_SRC_ICECLFLAGSEXTRA_H
#include "IceDefs.h"
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wredundant-move"
#endif // __clang__
#include "llvm/IRReader/IRReader.h"
#ifdef __clang__
#pragma clang diagnostic pop
#endif // __clang__
namespace Ice {
/// Declares command line flags primarily used for non-minimal builds.
class ClFlagsExtra {
ClFlagsExtra(const ClFlagsExtra &) = delete;
ClFlagsExtra &operator=(const ClFlagsExtra &) = delete;
public:
ClFlagsExtra() = default;
/// Get the value of ClFlagsExtra::AlwaysExitSuccess
bool getAlwaysExitSuccess() const { return AlwaysExitSuccess; }
/// Set ClFlagsExtra::AlwaysExitSuccess to a new value
void setAlwaysExitSuccess(bool NewValue) { AlwaysExitSuccess = NewValue; }
/// Get the value of ClFlagsExtra::BuildOnRead
bool getBuildOnRead() const { return BuildOnRead; }
/// Set ClFlagsExtra::BuildOnRead to a new value
void setBuildOnRead(bool NewValue) { BuildOnRead = NewValue; }
/// Get the value of ClFlagsExtra::GenerateBuildAtts
bool getGenerateBuildAtts() const { return GenerateBuildAtts; }
/// Set ClFlagsExtra::GenerateBuildAtts to a new value
void setGenerateBuildAtts(bool NewValue) { GenerateBuildAtts = NewValue; }
/// Get the value of ClFlagsExtra::LLVMVerboseErrors
bool getLLVMVerboseErrors() const { return LLVMVerboseErrors; }
/// Set ClFlagsExtra::LLVMVerboseErrors to a new value
void setLLVMVerboseErrors(bool NewValue) { LLVMVerboseErrors = NewValue; }
/// Get the value of ClFlagsExtra::BitcodeAsText
bool getBitcodeAsText() const { return BitcodeAsText; }
/// Set ClFlagsExtra::BitcodeAsText to a new value
void setBitcodeAsText(bool NewValue) { BitcodeAsText = NewValue; }
/// Get the value of ClFlagsExtra::InputFileFormat
llvm::NaClFileFormat getInputFileFormat() const { return InputFileFormat; }
/// Set ClFlagsExtra::InputFileFormat to a new value
void setInputFileFormat(llvm::NaClFileFormat NewValue) {
InputFileFormat = NewValue;
}
/// Get the value of ClFlagsExtra::AppName
const IceString &getAppName() const { return AppName; }
/// Set ClFlagsExtra::AppName to a new value
void setAppName(const IceString &NewValue) { AppName = NewValue; }
/// Get the value of ClFlagsExtra::IRFilename
const IceString &getIRFilename() const { return IRFilename; }
/// Set ClFlagsExtra::IRFilename to a new value
void setIRFilename(const IceString &NewValue) { IRFilename = NewValue; }
/// Get the value of ClFlagsExtra::LogFilename
const IceString &getLogFilename() const { return LogFilename; }
/// Set ClFlagsExtra::LogFilename to a new value
void setLogFilename(const IceString &NewValue) { LogFilename = NewValue; }
/// Get the value of ClFlagsExtra::OutputFilename
const IceString &getOutputFilename() const { return OutputFilename; }
/// Set ClFlagsExtra::OutputFilename to a new value
void setOutputFilename(const IceString &NewValue) {
OutputFilename = NewValue;
}
private:
/// see anonymous_namespace{IceClFlags.cpp}::AlwaysExitSuccess
bool AlwaysExitSuccess = false;
/// see anonymous_namespace{IceClFlags.cpp}::BitcodeAsText
bool BitcodeAsText = false;
/// see anonymous_namespace{IceClFlags.cpp}::BuildOnRead
bool BuildOnRead = false;
/// see anonymous_namespace{IceClFlags.cpp}::GenerateBuildAtts
bool GenerateBuildAtts = false;
/// see anonymous_namespace{IceClFlags.cpp}::LLVMVerboseErrors
bool LLVMVerboseErrors = false;
/// see anonymous_namespace{IceClFlags.cpp}::InputFileFormat
llvm::NaClFileFormat InputFileFormat = llvm::LLVMFormat;
/// see anonymous_namespace{IceClFlags.cpp}::AppName
IceString AppName = "";
/// see anonymous_namespace{IceClFlags.cpp}::IRFilename
IceString IRFilename = "";
/// see anonymous_namespace{IceClFlags.cpp}::LogFilename
IceString LogFilename = "";
/// see anonymous_namespace{IceClFlags.cpp}::OutputFilename
IceString OutputFilename = "";
};
} // end of namespace Ice
#endif // SUBZERO_SRC_ICECLFLAGSEXTRA_H
......@@ -15,7 +15,6 @@
#include "IceCompileServer.h"
#include "IceClFlags.h"
#include "IceClFlagsExtra.h"
#include "IceELFStreamer.h"
#include "IceGlobalContext.h"
#include "LinuxMallocProfiling.h"
......@@ -96,7 +95,7 @@ std::unique_ptr<Ostream> makeStream(const IceString &Filename,
}
ErrorCodes getReturnValue(ErrorCodes Val) {
if (GlobalContext::ExtraFlags.getAlwaysExitSuccess())
if (GlobalContext::Flags.getAlwaysExitSuccess())
return EC_None;
return Val;
}
......@@ -160,16 +159,14 @@ void CLCompileServer::run() {
}
ClFlags::parseFlags(argc, argv);
ClFlags &Flags = GlobalContext::Flags;
ClFlagsExtra &ExtraFlags = GlobalContext::ExtraFlags;
ClFlags::getParsedClFlags(Flags);
ClFlags::getParsedClFlagsExtra(ExtraFlags);
// Override report_fatal_error if we want to exit with 0 status.
if (ExtraFlags.getAlwaysExitSuccess())
if (Flags.getAlwaysExitSuccess())
llvm::install_fatal_error_handler(reportFatalErrorThenExitSuccess, this);
std::error_code EC;
std::unique_ptr<Ostream> Ls = makeStream(ExtraFlags.getLogFilename(), EC);
std::unique_ptr<Ostream> Ls = makeStream(Flags.getLogFilename(), EC);
if (EC) {
llvm::report_fatal_error("Unable to open log file");
}
......@@ -180,14 +177,14 @@ void CLCompileServer::run() {
std::unique_ptr<ELFStreamer> ELFStr;
switch (Flags.getOutFileType()) {
case FT_Elf: {
if (ExtraFlags.getOutputFilename() == "-") {
if (Flags.getOutputFilename() == "-" && !Flags.getGenerateBuildAtts()) {
*Ls << "Error: writing binary ELF to stdout is unsupported\n";
return transferErrorCode(getReturnValue(Ice::EC_Args));
}
std::unique_ptr<llvm::raw_fd_ostream> FdOs(new llvm::raw_fd_ostream(
ExtraFlags.getOutputFilename(), EC, llvm::sys::fs::F_None));
Flags.getOutputFilename(), EC, llvm::sys::fs::F_None));
if (EC) {
*Ls << "Failed to open output file: " << ExtraFlags.getOutputFilename()
*Ls << "Failed to open output file: " << Flags.getOutputFilename()
<< ":\n" << EC.message() << "\n";
return transferErrorCode(getReturnValue(Ice::EC_Args));
}
......@@ -199,9 +196,9 @@ void CLCompileServer::run() {
} break;
case FT_Asm:
case FT_Iasm: {
Os = makeStream(ExtraFlags.getOutputFilename(), EC);
Os = makeStream(Flags.getOutputFilename(), EC);
if (EC) {
*Ls << "Failed to open output file: " << ExtraFlags.getOutputFilename()
*Ls << "Failed to open output file: " << Flags.getOutputFilename()
<< ":\n" << EC.message() << "\n";
return transferErrorCode(getReturnValue(Ice::EC_Args));
}
......@@ -209,36 +206,36 @@ void CLCompileServer::run() {
} break;
}
if (BuildDefs::minimal() && ExtraFlags.getBitcodeAsText())
if (BuildDefs::minimal() && Flags.getBitcodeAsText())
llvm::report_fatal_error("Can't specify 'bitcode-as-text' flag in "
"minimal build");
IceString StrError;
std::unique_ptr<llvm::DataStreamer> InputStream(
(!BuildDefs::minimal() && ExtraFlags.getBitcodeAsText())
? TextDataStreamer::create(ExtraFlags.getIRFilename(), &StrError)
: llvm::getDataFileStreamer(ExtraFlags.getIRFilename(), &StrError));
(!BuildDefs::minimal() && Flags.getBitcodeAsText())
? TextDataStreamer::create(Flags.getIRFilename(), &StrError)
: llvm::getDataFileStreamer(Flags.getIRFilename(), &StrError));
if (!StrError.empty() || !InputStream) {
llvm::SMDiagnostic Err(ExtraFlags.getIRFilename(),
llvm::SourceMgr::DK_Error, StrError);
Err.print(ExtraFlags.getAppName().c_str(), *Ls);
llvm::SMDiagnostic Err(Flags.getIRFilename(), llvm::SourceMgr::DK_Error,
StrError);
Err.print(Flags.getAppName().c_str(), *Ls);
return transferErrorCode(getReturnValue(Ice::EC_Bitcode));
}
if (ExtraFlags.getGenerateBuildAtts()) {
if (Flags.getGenerateBuildAtts()) {
dumpBuildAttributes(*Os.get());
return transferErrorCode(getReturnValue(Ice::EC_None));
}
Ctx.reset(new GlobalContext(Ls.get(), Os.get(), Ls.get(), ELFStr.get()));
if (Ctx->getFlags().getNumTranslationThreads() != 0) {
std::thread CompileThread([this, &ExtraFlags, &InputStream]() {
std::thread CompileThread([this, &Flags, &InputStream]() {
Ctx->initParserThread();
getCompiler().run(ExtraFlags, *Ctx.get(), std::move(InputStream));
getCompiler().run(Flags, *Ctx.get(), std::move(InputStream));
});
CompileThread.join();
} else {
getCompiler().run(ExtraFlags, *Ctx.get(), std::move(InputStream));
getCompiler().run(Flags, *Ctx.get(), std::move(InputStream));
}
transferErrorCode(
getReturnValue(static_cast<ErrorCodes>(Ctx->getErrorStatus()->value())));
......
......@@ -22,7 +22,7 @@
#include "IceBuildDefs.h"
#include "IceCfg.h"
#include "IceClFlags.h"
#include "IceClFlagsExtra.h"
#include "IceClFlags.h"
#include "IceConverter.h"
#include "IceELFObjectWriter.h"
#include "PNaClTranslator.h"
......@@ -57,7 +57,7 @@ bool llvmIRInput(const IceString &Filename) {
} // end of anonymous namespace
void Compiler::run(const Ice::ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
void Compiler::run(const Ice::ClFlags &Flags, GlobalContext &Ctx,
std::unique_ptr<llvm::DataStreamer> &&InputStream) {
// The Minimal build (specifically, when dump()/emit() are not implemented)
// allows only --filetype=obj. Check here to avoid cryptic error messages
......@@ -77,9 +77,8 @@ void Compiler::run(const Ice::ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
Ctx.startWorkerThreads();
std::unique_ptr<Translator> Translator;
const IceString &IRFilename = ExtraFlags.getIRFilename();
const bool BuildOnRead =
ExtraFlags.getBuildOnRead() && !llvmIRInput(IRFilename);
const IceString &IRFilename = Flags.getIRFilename();
const bool BuildOnRead = Flags.getBuildOnRead() && !llvmIRInput(IRFilename);
if (BuildOnRead) {
std::unique_ptr<PNaClTranslator> PTranslator(new PNaClTranslator(&Ctx));
std::unique_ptr<llvm::StreamingMemoryObject> MemObj(
......@@ -100,14 +99,14 @@ void Compiler::run(const Ice::ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
llvm::SMDiagnostic Err;
TimerMarker T1(Ice::TimerStack::TT_parse, &Ctx);
llvm::DiagnosticHandlerFunction DiagnosticHandler =
ExtraFlags.getLLVMVerboseErrors()
Flags.getLLVMVerboseErrors()
? redirectNaClDiagnosticToStream(llvm::errs())
: nullptr;
std::unique_ptr<llvm::Module> Mod =
NaClParseIRFile(IRFilename, ExtraFlags.getInputFileFormat(), Err,
NaClParseIRFile(IRFilename, Flags.getInputFileFormat(), Err,
llvm::getGlobalContext(), DiagnosticHandler);
if (!Mod) {
Err.print(ExtraFlags.getAppName().c_str(), llvm::errs());
Err.print(Flags.getAppName().c_str(), llvm::errs());
Ctx.getErrorStatus()->assign(EC_Bitcode);
return;
}
......
......@@ -23,7 +23,7 @@ class DataStreamer;
namespace Ice {
class ClFlagsExtra;
class ClFlags;
/// A compiler driver. It may be called to handle a single compile request.
class Compiler {
......@@ -35,7 +35,7 @@ public:
/// Run the compiler with the given GlobalContext for compilation state. Upon
/// error, the Context's error status will be set.
void run(const ClFlagsExtra &ExtraFlags, GlobalContext &Ctx,
void run(const ClFlags &ExtraFlags, GlobalContext &Ctx,
std::unique_ptr<llvm::DataStreamer> &&InputStream);
};
......
......@@ -532,7 +532,7 @@ template <typename ConstType> void ELFObjectWriter::writeConstantPool(Type Ty) {
// If the -reorder-pooled-constant option is set to true, we should shuffle
// the constants before we emit them.
if (Ctx.getFlags().shouldReorderPooledConstants() && !Pool.empty()) {
if (Ctx.getFlags().getReorderPooledConstants() && !Pool.empty()) {
// Use the constant's kind value as the salt for creating random number
// generator.
Operand::OperandKind K = (*Pool.begin())->getKind();
......
......@@ -18,7 +18,6 @@
#include "IceCfg.h"
#include "IceCfgNode.h"
#include "IceClFlags.h"
#include "IceClFlagsExtra.h"
#include "IceDefs.h"
#include "IceELFObjectWriter.h"
#include "IceGlobalInits.h"
......@@ -427,7 +426,7 @@ void GlobalContext::lowerGlobals(const IceString &SectionSuffix) {
saveBlockInfoPtrs();
// If we need to shuffle the layout of global variables, shuffle them now.
if (getFlags().shouldReorderGlobalVariables()) {
if (getFlags().getReorderGlobalVariables()) {
// Create a random number generator for global variable reordering.
RandomNumberGenerator RNG(getFlags().getRandomSeed(),
RPE_GlobalVariableReordering);
......@@ -494,7 +493,7 @@ void GlobalContext::emitItems() {
bool EmitQueueEmpty = false;
const uint32_t ShuffleWindowSize =
std::max(1u, getFlags().getReorderFunctionsWindowSize());
bool Shuffle = Threaded && getFlags().shouldReorderFunctions();
bool Shuffle = Threaded && getFlags().getReorderFunctions();
// Create a random number generator for function reordering.
RandomNumberGenerator RNG(getFlags().getRandomSeed(), RPE_FunctionReordering);
......@@ -801,7 +800,7 @@ JumpTableDataList GlobalContext::getJumpTables() {
return A.getId() < B.getId();
});
if (getFlags().shouldReorderPooledConstants()) {
if (getFlags().getReorderPooledConstants()) {
// If reorder-pooled-constants option is set to true, we also shuffle the
// jump tables before emitting them.
......@@ -919,7 +918,6 @@ void GlobalContext::dumpTimers(TimerStackIdT StackID, bool DumpCumulative) {
}
ClFlags GlobalContext::Flags;
ClFlagsExtra GlobalContext::ExtraFlags;
TimerIdT TimerMarker::getTimerIdFromFuncName(GlobalContext *Ctx,
const IceString &FuncName) {
......
......@@ -492,7 +492,6 @@ public:
}
static ClFlags Flags;
static ClFlagsExtra ExtraFlags;
/// DisposeGlobalVariablesAfterLowering controls whether the memory used by
/// GlobaleVariables can be reclaimed right after they have been lowered.
......
......@@ -30,7 +30,6 @@
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wredundant-move"
#endif // __clang__
#include "llvm/Bitcode/NaCl/NaClBitcodeParser.h" // for NaClBitcodeRecord.
......
......@@ -27,6 +27,9 @@
#include "IceOperand.h"
#include "IceRegAlloc.h"
#include <string>
#include <vector>
#define TARGET_LOWERING_CLASS_FOR(t) Target_##t
// We prevent target-specific implementation details from leaking outside their
......@@ -179,14 +182,14 @@ void TargetLowering::filterTypeToRegisterSet(
RegNameToIndex[getRegName(RegNum)] = RegNum;
}
ClFlags::StringVector BadRegNames;
std::vector<std::string> BadRegNames;
// The processRegList function iterates across the RegNames vector. Each
// entry in the vector is a string of the form "<reg>" or "<class>:<reg>".
// The register class and register number are computed, and the corresponding
// bit is set in RegSet[][]. If "<class>:" is missing, then the bit is set
// for all classes.
auto processRegList = [&](const ClFlags::StringVector &RegNames,
auto processRegList = [&](const std::vector<std::string> &RegNames,
std::vector<SmallBitVector> &RegSet) {
for (const IceString &RegClassAndName : RegNames) {
IceString RClass;
......@@ -474,10 +477,10 @@ void TargetLowering::regAlloc(RegAllocKind Kind) {
if (hasFramePointer())
RegExclude |= RegSet_FramePointer;
SmallBitVector RegMask = getRegisterSet(RegInclude, RegExclude);
bool Repeat = (Kind == RAK_Global && Ctx->getFlags().shouldRepeatRegAlloc());
bool Repeat = (Kind == RAK_Global && Ctx->getFlags().getRepeatRegAlloc());
do {
LinearScan.init(Kind);
LinearScan.scan(RegMask, Ctx->getFlags().shouldRandomizeRegAlloc());
LinearScan.scan(RegMask, Ctx->getFlags().getRandomizeRegisterAllocation());
if (!LinearScan.hasEvictions())
Repeat = false;
Kind = RAK_SecondChance;
......
......@@ -1032,7 +1032,7 @@ void TargetARM32::translateO2() {
Func->processAllocas(SortAndCombineAllocas);
Func->dump("After Alloca processing");
if (!Ctx->getFlags().getPhiEdgeSplit()) {
if (!Ctx->getFlags().getEnablePhiEdgeSplit()) {
// Lower Phi instructions.
Func->placePhiLoads();
if (Func->hasError())
......@@ -1100,7 +1100,7 @@ void TargetARM32::translateO2() {
copyRegAllocFromInfWeightVariable64On32(Func->getVariables());
Func->dump("After linear scan regalloc");
if (Ctx->getFlags().getPhiEdgeSplit()) {
if (Ctx->getFlags().getEnablePhiEdgeSplit()) {
Func->advancedPhiLowering();
Func->dump("After advanced Phi lowering");
}
......@@ -1129,7 +1129,7 @@ void TargetARM32::translateO2() {
Func->dump("After branch optimization");
// Nop insertion
if (Ctx->getFlags().shouldDoNopInsertion()) {
if (Ctx->getFlags().getShouldDoNopInsertion()) {
Func->doNopInsertion();
}
}
......@@ -1191,7 +1191,7 @@ void TargetARM32::translateOm1() {
Func->dump("After postLowerLegalization");
// Nop insertion
if (Ctx->getFlags().shouldDoNopInsertion()) {
if (Ctx->getFlags().getShouldDoNopInsertion()) {
Func->doNopInsertion();
}
}
......@@ -6803,7 +6803,7 @@ template <typename T> void emitConstantPool(GlobalContext *Ctx) {
<< "\n"
<< "\t.align\t" << Align << "\n";
if (Ctx->getFlags().shouldReorderPooledConstants()) {
if (Ctx->getFlags().getReorderPooledConstants()) {
// TODO(jpp): add constant pooling.
UnimplementedError(Ctx->getFlags());
}
......
......@@ -137,7 +137,7 @@ void TargetMIPS32::translateO2() {
Func->processAllocas(SortAndCombineAllocas);
Func->dump("After Alloca processing");
if (!Ctx->getFlags().getPhiEdgeSplit()) {
if (!Ctx->getFlags().getEnablePhiEdgeSplit()) {
// Lower Phi instructions.
Func->placePhiLoads();
if (Func->hasError())
......@@ -200,7 +200,7 @@ void TargetMIPS32::translateO2() {
return;
Func->dump("After linear scan regalloc");
if (Ctx->getFlags().getPhiEdgeSplit()) {
if (Ctx->getFlags().getEnablePhiEdgeSplit()) {
Func->advancedPhiLowering();
Func->dump("After advanced Phi lowering");
}
......@@ -222,7 +222,7 @@ void TargetMIPS32::translateO2() {
Func->dump("After branch optimization");
// Nop insertion
if (Ctx->getFlags().shouldDoNopInsertion()) {
if (Ctx->getFlags().getShouldDoNopInsertion()) {
Func->doNopInsertion();
}
}
......@@ -267,7 +267,7 @@ void TargetMIPS32::translateOm1() {
Func->dump("After stack frame mapping");
// Nop insertion
if (Ctx->getFlags().shouldDoNopInsertion()) {
if (Ctx->getFlags().getShouldDoNopInsertion()) {
Func->doNopInsertion();
}
}
......
......@@ -391,7 +391,7 @@ template <typename TraitsType> void TargetX86Base<TraitsType>::translateO2() {
Func->processAllocas(SortAndCombineAllocas);
Func->dump("After Alloca processing");
if (!Ctx->getFlags().getPhiEdgeSplit()) {
if (!Ctx->getFlags().getEnablePhiEdgeSplit()) {
// Lower Phi instructions.
Func->placePhiLoads();
if (Func->hasError())
......@@ -477,7 +477,7 @@ template <typename TraitsType> void TargetX86Base<TraitsType>::translateO2() {
return;
Func->dump("After linear scan regalloc");
if (Ctx->getFlags().getPhiEdgeSplit()) {
if (Ctx->getFlags().getEnablePhiEdgeSplit()) {
Func->advancedPhiLowering();
Func->dump("After advanced Phi lowering");
}
......@@ -7303,7 +7303,7 @@ void TargetDataX86<TraitsType>::emitConstantPool(GlobalContext *Ctx) {
// If reorder-pooled-constants option is set to true, we need to shuffle the
// constant pool before emitting it.
if (Ctx->getFlags().shouldReorderPooledConstants() && !Pool.empty()) {
if (Ctx->getFlags().getReorderPooledConstants() && !Pool.empty()) {
// Use the constant's kind value as the salt for creating random number
// generator.
Operand::OperandKind K = (*Pool.begin())->getKind();
......
......@@ -22,7 +22,6 @@
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-parameter"
#pragma clang diagnostic ignored "-Wredundant-move"
#endif // __clang__
#include "llvm/IR/DerivedTypes.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment