llvm-project/llvm/test/Transforms
David Bolvansky 420cbb6190 [InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y))
Summary:
```
Name: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
%or = or i32 %y, %x
%xor = xor i32 %x, %y
%sub = sub i32 %xor, %or
  =>
%sub1 = and i32 %x, %y
%sub = sub i32 0, %sub1

Optimization: sub(xor(x, y), or(x, y)) -> neg(and(x, y))
Done: 1
Optimization is correct!
```

https://rise4fun.com/Alive/8OI

Reviewers: lebedev.ri

Reviewed By: lebedev.ri

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D67188

llvm-svn: 370945
2019-09-04 18:03:21 +00:00
..
ADCE Add missing test for r366215 2019-07-16 15:28:29 +00:00
AddDiscriminators Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
AggressiveInstCombine Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
AlignmentFromAssumptions [AlignmentFromAssumptions] getNewAlignmentDiff(): use getURemExpr() 2019-08-23 02:17:04 +00:00
ArgumentPromotion IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
AtomicExpand [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
BDCE Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
BlockExtractor [BlockExtractor] Avoid assert with wrong line format 2019-08-20 14:46:02 +00:00
BranchFolding Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
CallSiteSplitting CallSiteSplitting: Respect convergent and noduplicate 2019-05-29 16:59:48 +00:00
CalledValuePropagation Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
CanonicalizeAliases Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
CodeExtractor [CodeExtractor] Fix sinking of allocas with multiple bitcast uses (PR42451) 2019-07-10 16:32:20 +00:00
CodeGenPrepare [CodeGenPrepare] Fix use-after-free 2019-08-16 23:10:34 +00:00
ConstProp [ConstantFolding] Fix 'undef' folding for @llvm.[us]{add,sub}.with.overflow ops (PR43188) 2019-09-01 11:56:52 +00:00
ConstantHoisting [RISCV] Fix RISCVTTIImpl::getIntImmCost for immediates where getMinSignedBits() > 64 2019-07-09 10:56:18 +00:00
ConstantMerge Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
Coroutines [coroutine] Fixes "cannot move instruction since its users are not dominated by CoroBegin" problem. 2019-08-15 00:48:51 +00:00
CorrelatedValuePropagation [CVP] Add tests for simplified with.overflow + icmp; NFC 2019-08-31 09:58:42 +00:00
CrossDSOCFI Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
DCE Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
DeadArgElim [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
DeadStoreElimination [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
DivRemPairs [DivRemPairs] Recommit: Handling for expanded-form rem - recomposition (PR42673) 2019-07-31 12:06:51 +00:00
EarlyCSE [EarlyCSE] Add support for unary FNeg to EarlyCSE 2019-08-07 14:34:41 +00:00
EliminateAvailableExternally Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
EntryExitInstrumenter Reland "[ARM] push LR before __gnu_mcount_nc" 2019-08-16 23:30:16 +00:00
ExpandMemCmp/X86 Revert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline." 2019-06-26 12:13:13 +00:00
Float2Int [Float2Int] Add support for unary FNeg to Float2Int 2019-07-08 14:46:07 +00:00
ForcedFunctionAttrs Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
FunctionAttrs [Attributor] Look at internal functions only on-demand 2019-09-04 16:35:20 +00:00
FunctionImport Revert "Change the X86 datalayout to add three address spaces for 32 bit signed," 2019-08-28 01:08:54 +00:00
GCOVProfiling Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
GVN [GVN] Propagate simple equalities from assumes within the tail of the block 2019-09-03 17:31:19 +00:00
GVNHoist Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
GVNSink [GVNSink] Add unary FNeg support to GVNSink pass 2019-06-28 19:57:31 +00:00
GlobalDCE [IR] Disallow llvm.global_ctors and llvm.global_dtors of the 2-field form in textual format 2019-05-15 02:35:32 +00:00
GlobalMerge Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
GlobalOpt [GlobalOpt] prevent crashing on large integer types (PR42932) 2019-08-09 12:43:25 +00:00
GlobalSplit Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
GuardWidening [GuardWidening] Wire up a NPM version of the LoopGuardWidening pass 2019-04-18 19:17:14 +00:00
HardwareLoops [ARM][LowOverheadLoops] Enable by default 2019-07-30 08:14:28 +00:00
HotColdSplit [CodeExtractor] Fix sinking of allocas with multiple bitcast uses (PR42451) 2019-07-10 16:32:20 +00:00
IPConstantProp Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
IRCE [SCEV] Pass NoWrapFlags when expanding an AddExpr 2019-06-14 09:19:41 +00:00
IndVarSimplify [IndVars] Fix a bug noticed by inspection 2019-08-23 04:03:23 +00:00
IndirectBrExpand Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
InferAddressSpaces InferAddressSpaces: Fix cloning original addrspacecast 2019-06-17 14:13:29 +00:00
InferFunctionAttrs [BuildLibCalls] Noalias annotation 2019-08-14 16:50:06 +00:00
Inline [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
InstCombine [InstCombine] sub(xor(x, y), or(x, y)) -> neg(and(x, y)) 2019-09-04 18:03:21 +00:00
InstMerge Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
InstNamer Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
InstSimplify [InstSimplify] guard against unreachable code (PR43218) 2019-09-04 15:12:55 +00:00
InterleavedAccess Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
Internalize Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
JumpThreading IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
LCSSA Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LICM [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
LoadStoreVectorizer Handle casts changing pointer size in the vectorizer 2019-08-02 04:03:37 +00:00
LoopDataPrefetch Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LoopDeletion Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LoopDistribute Revert "[IRBuilder] Fold consistently for or/and whether constant is LHS or RHS" 2019-07-07 22:12:01 +00:00
LoopFusion [LoopFusion] Extend use of OptimizationRemarkEmitter 2019-07-30 15:58:43 +00:00
LoopIdiom Revert r370454 "[LoopIdiomRecognize] BCmp loop idiom recognition" 2019-09-03 17:14:56 +00:00
LoopInstSimplify [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
LoopInterchange [LoopInterchange] Fix handling of LCSSA nodes defined in headers and latches. 2019-05-26 23:38:25 +00:00
LoopLoadElim LoopLoadElim: Respect convergent 2019-06-12 13:50:47 +00:00
LoopPredication [LoopPred] Extend LFTR normalization to the inverse EQ case 2019-07-09 01:27:45 +00:00
LoopReroll [SCEV] Use NoWrapFlags when expanding a simple mul 2019-06-17 10:05:18 +00:00
LoopRotate [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
LoopSimplify [DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion 2019-06-19 10:50:47 +00:00
LoopSimplifyCFG Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LoopStrengthReduce [NFC][LSR] Avoid undefined grep in pr2570.ll 2019-06-19 16:02:54 +00:00
LoopTransformWarning Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LoopUnroll [LoopUnroll] Handle certain PHIs in full unrolling properly 2019-08-26 09:29:53 +00:00
LoopUnrollAndJam Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LoopUnswitch [LoopUnroll+LoopUnswitch] do not transform loops containing callbr 2019-07-15 21:16:29 +00:00
LoopVectorize [LV] Fix miscompiles by adding non-header PHI nodes to AllowedExit 2019-09-03 09:33:55 +00:00
LoopVersioning LoopVersioning: Respect convergent 2019-06-12 14:05:58 +00:00
LoopVersioningLICM LoopVersioningLICM: Respect convergent and noduplicate 2019-05-29 20:47:59 +00:00
LowerAtomic Transforms: lower fadd and fsub atomicrmw instructions 2019-05-23 17:03:43 +00:00
LowerExpectIntrinsic Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LowerGuardIntrinsic Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LowerInvoke Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
LowerSwitch Fix a crash when the default of a switch is removed 2019-06-03 17:54:15 +00:00
LowerTypeTests cfi-icall: Allow the jump table to be optionally made non-canonical. 2019-08-09 22:31:59 +00:00
LowerWidenableCondition Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
MakeGuardsExplicit Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
Mem2Reg Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
MemCpyOpt [BuildLibCalls] Noalias annotation 2019-08-14 16:50:06 +00:00
MergeFunc IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00
MergeICmps [MergeICmps] Make the pass compatible with the new pass manager. 2019-05-23 12:35:26 +00:00
MetaRenamer Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
NameAnonGlobals Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
NaryReassociate Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
NewGVN [NFC][NewGVN] Explicitly check fpmath metadata in fpmath.ll 2019-06-28 21:39:08 +00:00
ObjCARC [FunctionAttrs] Annotate "willreturn" for intrinsics 2019-07-28 06:09:56 +00:00
PGOProfile Revert "Change the X86 datalayout to add three address spaces for 32 bit signed," 2019-08-28 01:08:54 +00:00
PartiallyInlineLibCalls Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
PhaseOrdering [InstSimplify] Drop leftover "division-by-zero guard" around `@llvm.umul.with.overflow` inverted overflow bit 2019-08-29 12:48:04 +00:00
PlaceSafepoints Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
PreISelIntrinsicLowering Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
PruneEH Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
Reassociate [Reassoc] Small fix to support unary FNeg in NegateValue(...) 2019-08-23 15:49:38 +00:00
Reg2Mem Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
RewriteStatepointsForGC Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
SCCP [SCCP] Update condition to avoid overflow. 2019-07-31 18:22:22 +00:00
SLPVectorizer [SLP] add test that requires shuffle of scalars; NFC 2019-08-19 12:41:09 +00:00
SROA [Loads/SROA] Remove blatantly incorrect code and fix a bug revealed in the process 2019-08-27 19:34:43 +00:00
SafeStack [SafeStack] Insert the deref before remaining elements 2019-07-24 00:16:23 +00:00
SampleProfile [SampleFDO] Add profile symbol list section to discriminate function being 2019-08-31 02:27:26 +00:00
ScalarizeMaskedMemIntrin/X86 [ScalarizeMaskedMemIntrin] Add test case for expanding scatter. 2019-08-07 23:16:29 +00:00
Scalarizer [Scalarizer] Add scalarizer support for smul.fix.sat 2019-06-24 12:07:11 +00:00
SeparateConstOffsetFromGEP [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
SimpleLoopUnswitch [LoopPassManager + MemorySSA] Only enable use of MemorySSA for LPMs known to preserve it. 2019-08-21 17:00:57 +00:00
SimplifyCFG [SimplifyCFG] Skip sinking common lifetime markers of `alloca`. 2019-08-29 16:12:05 +00:00
Sink Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
SpeculateAroundPHIs Ignore indirect branches from callbr. 2019-08-14 16:44:07 +00:00
SpeculativeExecution Support FNeg in SpeculativeExecution pass 2019-05-14 16:51:18 +00:00
StackProtector/X86 [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
StraightLineStrengthReduce Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
StripDeadPrototypes Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
StripSymbols Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
StructurizeCFG StructurizeCFG: Relax uniformity checks. 2019-05-24 08:59:17 +00:00
SyntheticCountsPropagation Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
TailCallElim Revert "Temporarily Revert "Add basic loop fusion pass."" 2019-04-17 04:52:47 +00:00
ThinLTOBitcodeWriter cfi-icall: Allow the jump table to be optionally made non-canonical. 2019-08-09 22:31:59 +00:00
Util [Debuginfo][SROA] Need to handle dbg.value in SROA pass. 2019-09-04 14:19:49 +00:00
WholeProgramDevirt IR: print value numbers for unnamed function arguments 2019-08-03 14:28:34 +00:00