diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-02-19 23:36:51 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-02-19 23:36:51 +0000 |
commit | 5ce8dd93efa4f2d1af187bd41e7d76dd5dd3e423 (patch) | |
tree | cd68355bd59507762b0a185647ac4eaf28b5d99a | |
parent | 8b51bc47a29e1755c7ef478f629b90c027318547 (diff) | |
download | bcm5719-llvm-5ce8dd93efa4f2d1af187bd41e7d76dd5dd3e423.tar.gz bcm5719-llvm-5ce8dd93efa4f2d1af187bd41e7d76dd5dd3e423.zip |
Add hidden option -x86-fold-and-in-test to test the effect the test / and folding change.
llvm-svn: 47351
-rw-r--r-- | llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/Target/X86/X86InstrInfo.td | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp index 5822f946e2c..db0c721f713 100644 --- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp +++ b/llvm/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/llvm/lib/Target/X86/X86InstrInfo.td b/llvm/lib/Target/X86/X86InstrInfo.td index 4482da7d4b1..276468c8fd2 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.td +++ b/llvm/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(); }]>; //===----------------------------------------------------------------------===// |