Add hidden option -x86-fold-and-in-test to test the effect the test / and folding change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47351 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-02-19 23:36:51 +00:00
parent 5a97097e56
commit e9c608d6cc
2 changed files with 7 additions and 1 deletions

View File

@ -32,6 +32,7 @@
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/SelectionDAGISel.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/MathExtras.h"
@ -43,6 +44,11 @@ using namespace llvm;
STATISTIC(NumFPKill , "Number of FP_REG_KILL instructions added");
STATISTIC(NumLoadMoved, "Number of loads moved below TokenFactor");
namespace {
static cl::opt<bool>
FoldAndInTest("x86-fold-and-in-test", cl::desc("Fold and operation in test"),
cl::init(true), cl::Hidden);
}
//===----------------------------------------------------------------------===//
// Pattern Matcher Implementation

View File

@ -248,7 +248,7 @@ def extloadi32i16 : PatFrag<(ops node:$ptr), (i32 (extloadi16 node:$ptr))>;
// An 'and' node with a single use.
def and_su : PatFrag<(ops node:$lhs, node:$rhs), (and node:$lhs, node:$rhs), [{
return N->hasOneUse();
return !FoldAndInTest || N->hasOneUse();
}]>;
//===----------------------------------------------------------------------===//