llvm-6502/lib/Transforms/InstCombine
Hal Finkel b19dd2bcaf Revert r185257 (InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms)
I'm reverting this commit because:

 1. As discussed during review, it needs to be rewritten (to avoid creating and
then deleting instructions).

 2. This is causing optimizer crashes. Specifically, I'm seeing things like
this:

    While deleting: i1 %
    Use still stuck around after Def is destroyed:  <badref> = select i1 <badref>, i32 0, i32 1
    opt: /src/llvm-trunk/lib/IR/Value.cpp:79: virtual llvm::Value::~Value(): Assertion `use_empty() && "Uses remain when a value is destroyed!"' failed.

   I'd guess that these will go away once we're no longer creating/deleting
instructions here, but just in case, I'm adding a regression test.

Because the code is bring rewritten, I've just XFAIL'd the original regression test. Original commit message:

	InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms

	Real world code sometimes has the denominator of a 'udiv' be a
	'select'.  LLVM can handle such cases but only when the 'select'
	operands are symmetric in structure (both select operands are a constant
	power of two or a left shift, etc.).  This falls apart if we are dealt a
	'udiv' where the code is not symetric or if the select operands lead us
	to more select instructions.

	Instead, we should treat the LHS and each select operand as a distinct
	divide operation and try to optimize them independently.  If we can
	to simplify each operation, then we can replace the 'udiv' with, say, a
	'lshr' that has a new select with a bunch of new operands for the
	select.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185415 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 05:21:11 +00:00
..
CMakeLists.txt Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombine.h Reapply with r182909 with a fix to the calculation of the new indices for 2013-05-31 00:59:42 +00:00
InstCombineAddSub.cpp In InstCombine{AddSub,MulDivRem} convert APFloat.isFiniteNonZero() && !APFloat.isDenormal => APFloat.isNormal. 2013-06-26 23:17:31 +00:00
InstCombineAndOrXor.cpp Remove unneeded cast<>. 2013-06-06 00:49:57 +00:00
InstCombineCalls.cpp Fix using arg_end() - arg_begin() instead of arg_size() 2013-06-28 00:25:40 +00:00
InstCombineCasts.cpp InstCombine: Don't claim to be able to evaluate any shl in a zexted type. 2013-05-10 16:26:37 +00:00
InstCombineCompares.cpp InstCombine: FoldGEPICmp shouldn't change sign of base pointer comparison 2013-06-29 10:28:04 +00:00
InstCombineLoadStoreAlloca.cpp Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombineMulDivRem.cpp Revert r185257 (InstCombine: Be more agressive optimizing 'udiv' instrs with 'select' denoms) 2013-07-02 05:21:11 +00:00
InstCombinePHI.cpp Tidy up a bit. No functional change. 2013-04-05 21:20:12 +00:00
InstCombineSelect.cpp InstCombine: Also turn selects fed by an and into arithmetic when the types don't match. 2013-06-29 21:17:04 +00:00
InstCombineShifts.cpp Revert r174152. The shift amount may overflow and in that case this transformation is illegal. 2013-02-01 07:59:33 +00:00
InstCombineSimplifyDemanded.cpp InstCombine: Don't just copy known bits from the first operand of an srem. 2013-05-09 16:32:32 +00:00
InstCombineVectorOps.cpp Delete dead safety check. 2013-06-03 23:15:20 +00:00
InstCombineWorklist.h Remove trailing spaces. 2013-01-14 23:16:36 +00:00
InstructionCombining.cpp Add ArrayRef constructor from None, and do the cleanups that this constructor enables 2013-05-05 00:40:33 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile