diff options
-rw-r--r-- | lib/Target/X86/X86ISelDAGToDAG.cpp | 6 | ||||
-rw-r--r-- | lib/Target/X86/X86InstrInfo.td | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp index 5822f94..db0c721 100644 --- a/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/lib/Target/X86/X86ISelDAGToDAG.cpp @@ -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 diff --git a/lib/Target/X86/X86InstrInfo.td b/lib/Target/X86/X86InstrInfo.td index 4482da7..276468c 100644 --- a/lib/Target/X86/X86InstrInfo.td +++ b/lib/Target/X86/X86InstrInfo.td @@ -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(); }]>; //===----------------------------------------------------------------------===// |