]> granicus.if.org Git - llvm/commitdiff
[X86] Don't lie about legality to TLI's demanded bits.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 27 Jul 2017 21:28:59 +0000 (21:28 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Thu, 27 Jul 2017 21:28:59 +0000 (21:28 +0000)
Like r309323, X86 had a typo where it passed the wrong flags to TLO.

Found by inspection; I haven't been able to tickle this into having
observable behavior.  I don't think it does, given that X86 doesn't have
custom demanded bits logic, and the generic logic doesn't have a lot of
exposure to illegal constructs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309325 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86ISelLowering.cpp

index ba6a924e531f6807c519c52e48fe18090a9f079e..bcf7874a4066bf856d39274294bd795090468c3f 100644 (file)
@@ -30573,8 +30573,8 @@ static SDValue combineSelect(SDNode *N, SelectionDAG &DAG,
     assert(BitWidth >= 8 && BitWidth <= 64 && "Invalid mask size");
     APInt DemandedMask(APInt::getSignMask(BitWidth));
     KnownBits Known;
-    TargetLowering::TargetLoweringOpt TLO(DAG, DCI.isBeforeLegalize(),
-                                          DCI.isBeforeLegalizeOps());
+    TargetLowering::TargetLoweringOpt TLO(DAG, !DCI.isBeforeLegalize(),
+                                          !DCI.isBeforeLegalizeOps());
     if (TLI.ShrinkDemandedConstant(Cond, DemandedMask, TLO) ||
         TLI.SimplifyDemandedBits(Cond, DemandedMask, Known, TLO)) {
       // If we changed the computation somewhere in the DAG, this change will