projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Teach instCombine to remove malloc+free if malloc's only uses are comparisons
[oota-llvm.git]
/
lib
/
Transforms
/
InstCombine
/
InstCombineCalls.cpp
diff --git
a/lib/Transforms/InstCombine/InstCombineCalls.cpp
b/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 38e7b6ec2d1f98bb9e6f914c5a236d7bbe4dcf5f..08a6ff41ebb23b1c9b82c06de95046ac3da26f4e 100644
(file)
--- a/
lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/
lib/Transforms/InstCombine/InstCombineCalls.cpp
@@
-250,6
+250,8
@@
Instruction *InstCombiner::SimplifyMemSet(MemSetInst *MI) {
Instruction *InstCombiner::visitCallInst(CallInst &CI) {
if (isFreeCall(&CI))
return visitFree(CI);
+ if (isMalloc(&CI))
+ return visitMalloc(CI);
// If the caller function is nounwind, mark the call as nounwind, even if the
// callee isn't.