llvm-6502/lib/Transforms/InstCombine
Meador Inge a241b58f8d instcombine: Don't replace all uses for instructions with no uses
My commit to migrate the printf simplifiers from the simplify-libcalls
in r168604 introduced a regression reported by Duncan [1].  The problem
is that in some cases the library call simplifier can return a new value
that has no uses and the new value's type is different than the old value's
type (which is fine because there are no uses).  The specific case that
triggered the bug looked something like:

   declare void @printf(i8*, ...)
   ...
   call void (i8*, ...)* @printf(i8* %fmt)

Which we want to optimized into:

   call i32 @putchar(i32 104)

However, the code was attempting to replace all uses of the printf with
the putchar and the types differ, hence a crash.  This is fixed by *just*
deleting the original instruction when there are no uses.  The old
simplify-libcalls pass is already doing something similar.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-November/056338.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168716 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 18:52:49 +00:00
..
CMakeLists.txt llvm/lib: [CMake] Add explicit dependency to intrinsics_gen. 2012-06-24 13:32:01 +00:00
InstCombine.h Revert the series of commits starting with r166578 which introduced the 2012-11-01 08:07:29 +00:00
InstCombineAddSub.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstCombineAndOrXor.cpp rdar://12329730 (defect 2) 2012-11-26 21:44:25 +00:00
InstCombineCalls.cpp instcombine: Don't replace all uses for instructions with no uses 2012-11-27 18:52:49 +00:00
InstCombineCasts.cpp Revert the majority of the next patch in the address space series: 2012-11-01 09:14:31 +00:00
InstCombineCompares.cpp Make this easier to understand, as suggested by Chandler. 2012-11-16 20:53:08 +00:00
InstCombineLoadStoreAlloca.cpp Get rid of the getPointeeAlignment helper function from 2012-11-26 23:04:53 +00:00
InstCombineMulDivRem.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstCombinePHI.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstCombineSelect.cpp InstCombine: Fix an edge case where constant icmps could sneak into ConstantFoldInstOperands and crash. 2012-10-20 08:43:52 +00:00
InstCombineShifts.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstCombineSimplifyDemanded.cpp Move TargetData to DataLayout. 2012-10-08 16:38:25 +00:00
InstCombineVectorOps.cpp [InstCombine] Teach InstCombine how to handle an obfuscated splat. 2012-10-16 21:29:38 +00:00
InstCombineWorklist.h Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments. 2012-09-15 17:09:36 +00:00
InstructionCombining.cpp instcombine: Migrate math library call simplifications 2012-11-13 04:16:17 +00:00
LLVMBuild.txt LLVMBuild: Remove trailing newline, which irked me. 2011-12-12 19:48:00 +00:00
Makefile make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. 2010-01-24 20:43:08 +00:00