1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
llvm-mirror/test/Transforms
Sanjay Patel 61ecb7fad2 [InstCombine] match De Morgan's Law hidden by zext ops (PR22723)
This is a fix for PR22723:
https://llvm.org/bugs/show_bug.cgi?id=22723

My first attempt at this was to change what I thought was the root problem:

xor (zext i1 X to i32), 1 --> zext (xor i1 X, true) to i32

...but we create the opposite pattern in InstCombiner::visitZExt(), so infinite loop!

My next idea was to fix the matchIfNot() implementation in PatternMatch, but that would
mean potentially returning a different size for the match than what was input. I think
this would require all users of m_Not to check the size of the returned match, so I 
abandoned that idea.

I settled on just fixing the exact case presented in the PR. This patch does allow the
2 functions in PR22723 to compile identically (x86):

bool test(bool x, bool y) { return !x | !y; }
bool test(bool x, bool y) { return !x || !y; }
...
andb	%sil, %dil
xorb	$1, %dil
movb	%dil, %al
retq

Differential Revision: http://reviews.llvm.org/D12705

llvm-svn: 248634
2015-09-25 23:21:38 +00:00
..
ADCE Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
AddDiscriminators DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
AlignmentFromAssumptions
ArgumentPromotion DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
AtomicExpand [ARM] Emit clrex in the expanded cmpxchg fail block. 2015-09-22 17:22:58 +00:00
BBVectorize [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
BDCE Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
BranchFolding Make the default triple optional by allowing an empty string 2015-09-16 05:34:32 +00:00
CodeExtractor Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
CodeGenPrepare Introducing llvm.invariant.group.barrier intrinsic 2015-09-15 18:32:14 +00:00
ConstantHoisting
ConstantMerge [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
ConstProp [test] (NFC) Simplify Transforms/ConstProp/calls.ll 2015-08-28 18:04:20 +00:00
CorrelatedValuePropagation [LazyValueInfo] Report nonnull range for nonnull pointers 2015-09-18 13:01:48 +00:00
DeadArgElim [DeadArgElim] Split the invoke successor edge 2015-09-23 15:41:09 +00:00
DeadStoreElimination [DeadStoreElimination] Remove dead zero store to calloc initialized memory 2015-09-23 11:38:44 +00:00
EarlyCSE Allow value forwarding past release fences in EarlyCSE 2015-08-27 01:32:33 +00:00
EliminateAvailableExternally Don't change the visibility when converting a definition to a declaration. 2015-07-13 14:18:22 +00:00
Float2Int
FunctionAttrs [FunctionAttr] Infer nonnull attributes on returns 2015-08-31 19:44:38 +00:00
GCOVProfiling DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
GlobalDCE [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
GlobalOpt Introducing llvm.invariant.group.barrier intrinsic 2015-09-15 18:32:14 +00:00
GVN [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
IndVarSimplify Revert two SCEV changes that caused test failures in clang. 2015-09-25 21:16:50 +00:00
Inline [Inline] Use AssumptionCache from the right Function 2015-09-23 15:49:08 +00:00
InstCombine [InstCombine] match De Morgan's Law hidden by zext ops (PR22723) 2015-09-25 23:21:38 +00:00
InstMerge
InstSimplify Merge or combine tests and convert to FileCheck. 2015-09-08 18:36:56 +00:00
Internalize [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
IPConstantProp Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
IRCE
JumpThreading [LazyValueInfo] Look through Phi nodes when trying to prove a predicate 2015-08-31 18:31:48 +00:00
LCSSA Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
LICM [LICM] Hoist calls to readonly argmemonly functions even with stores in the loop 2015-09-21 22:27:59 +00:00
LoadCombine
LoopDeletion
LoopDistribute [LAA] Hold bounds via ValueHandles during SCEV expansion 2015-08-21 23:19:57 +00:00
LoopIdiom DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
LoopInterchange Add support to interchange loops with reductions. 2015-04-23 04:51:44 +00:00
LoopReroll Handle loop with negtive induction variable increment 2015-07-24 22:01:49 +00:00
LoopRotate DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
LoopSimplify DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
LoopStrengthReduce DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
LoopUnroll [Unroll] Do not crash trying to propagate a value to vector load. 2015-09-22 22:27:12 +00:00
LoopUnswitch Remove handling of AddrSpaceCast in stripAndAccumulateInBoundsConstantOffsets 2015-09-23 19:48:43 +00:00
LoopVectorize [LoopUtils,LV] Propagate fast-math flags on generated FCmp instructions 2015-09-21 19:41:19 +00:00
LowerAtomic
LowerBitSets [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
LowerExpectIntrinsic
LowerInvoke Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
LowerSwitch [LowerSwitch] Fix a bug when LowerSwitch deletes the default block 2015-08-11 18:12:26 +00:00
Mem2Reg DI: Update tests before adding !dbg subprogram attachments 2015-08-28 23:32:00 +00:00
MemCpyOpt Emit argmemonly attribute for intrinsics. 2015-08-13 17:40:04 +00:00
MergeFunc [MergeFuncs] Fix bug in merging GetElementPointers 2015-09-14 15:37:48 +00:00
MetaRenamer [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
NaryReassociate [NaryReassociate] Improve test CHECK 2015-09-16 05:27:46 +00:00
ObjCARC [PM/AA] Rebuild LLVM's alias analysis infrastructure in a way compatible 2015-09-09 17:55:00 +00:00
PartiallyInlineLibCalls
PhaseOrdering Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
PlaceSafepoints [PlaceSafepoints] Make the width of a counted loop settable. 2015-09-15 01:42:48 +00:00
PruneEH [PruneEH] A naked, noinline function can return via InlineAsm 2015-06-27 07:52:53 +00:00
Reassociate Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI 2015-08-10 19:01:27 +00:00
Reg2Mem Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
RewriteStatepointsForGC [RewriteStatepointsForGC] Extend base pointer inference to handle insertelement 2015-09-09 23:40:12 +00:00
SafeStack [safestack] Fix compiler crash in the presence of stack restores. 2015-09-24 01:23:51 +00:00
SampleProfile Use fixed-point representation for BranchProbability. 2015-09-25 23:09:59 +00:00
Scalarizer DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
ScalarRepl DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
SCCP [opaque pointer type] Add textual IR support for explicit type parameter for global aliases 2015-09-11 03:22:04 +00:00
SeparateConstOffsetFromGEP [SeparateConstOffsetFromGEP] sext(a)+sext(b) => sext(a+b) when a+b can't sign-overflow. 2015-08-14 02:02:05 +00:00
SimplifyCFG set div/rem default values to 'expensive' in TargetTransformInfo's cost model 2015-09-23 22:28:18 +00:00
Sink Teach the IR Sink pass to (conservatively) respect convergent annotations. 2015-06-01 17:20:31 +00:00
SLPVectorizer DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
SpeculativeExecution Add a speculative execution pass 2015-05-15 17:54:48 +00:00
SROA [PM] Port SROA to the new pass manager. 2015-09-12 09:09:14 +00:00
StraightLineStrengthReduce [SeparateConstOffsetFromGEP] strengthen the inbounds attribute 2015-08-13 18:48:49 +00:00
StripSymbols DI: Require subprogram definitions to be distinct 2015-08-28 20:26:49 +00:00
StructurizeCFG Fix CHECK directives that weren't checking. 2015-08-31 21:10:35 +00:00
TailCallElim Fix a bunch of trivial cases of 'CHECK[^:]*$' in the tests. NFCI 2015-08-10 19:01:27 +00:00
TailDup
Util Changed renaming of local symbols by inserting a dot vefore the numeric suffix. 2015-05-12 16:47:30 +00:00