[llvm] r340540 - [x86] add debug option for and-immediate shrinking
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 23 08:58:08 PDT 2018
Author: spatel
Date: Thu Aug 23 08:58:07 2018
New Revision: 340540
URL: http://llvm.org/viewvc/llvm-project?rev=340540&view=rev
Log:
[x86] add debug option for and-immediate shrinking
The commit that added this functionality:
rL322957
may be causing/exposing a miscompile in PR38648:
https://bugs.llvm.org/show_bug.cgi?id=38648
so allow enabling/disabling to make debugging easier.
Modified:
llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp?rev=340540&r1=340539&r2=340540&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelDAGToDAG.cpp Thu Aug 23 08:58:07 2018
@@ -41,6 +41,10 @@ using namespace llvm;
STATISTIC(NumLoadMoved, "Number of loads moved below TokenFactor");
+static cl::opt<bool> AndImmShrink("x86-and-imm-shrink", cl::init(true),
+ cl::desc("Enable setting constant bits to reduce size of mask immediates"),
+ cl::Hidden);
+
//===----------------------------------------------------------------------===//
// Pattern Matcher Implementation
//===----------------------------------------------------------------------===//
@@ -2927,7 +2931,7 @@ void X86DAGToDAGISel::Select(SDNode *Nod
case ISD::AND:
if (matchBEXTRFromAnd(Node))
return;
- if (shrinkAndImmediate(Node))
+ if (AndImmShrink && shrinkAndImmediate(Node))
return;
LLVM_FALLTHROUGH;
More information about the llvm-commits
mailing list