summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorMeador Inge <meadori@codesourcery.com>2012-11-27 18:52:49 +0000
committerMeador Inge <meadori@codesourcery.com>2012-11-27 18:52:49 +0000
commitf1bc9e74317c471017c62dca1a5695e296b27074 (patch)
tree3da00591d1ebbdc100c65239722e2998e6ff3e67 /llvm/lib/CodeGen/MachineCSE.cpp
parent6852b553146ae9167db3b6a2ab5750474a8f17d7 (diff)
downloadbcm5719-llvm-f1bc9e74317c471017c62dca1a5695e296b27074.tar.gz
bcm5719-llvm-f1bc9e74317c471017c62dca1a5695e296b27074.zip
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 llvm-svn: 168716
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud