diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-03-11 18:03:05 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-03-11 18:03:05 +0000 |
commit | d61a6fd8ed3c2547ba6896881f6b681afa9276ff (patch) | |
tree | 099b582942aca09e075ea3bf7831264b50315f55 /llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | |
parent | 81514e0660d19506db2bcc78eff670043be73d42 (diff) | |
download | bcm5719-llvm-d61a6fd8ed3c2547ba6896881f6b681afa9276ff.tar.gz bcm5719-llvm-d61a6fd8ed3c2547ba6896881f6b681afa9276ff.zip |
InstCombine: Don't fold call bitcast into args if callee is byval
This fixes a bug reported here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150309/265341.html
llvm-svn: 231948
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index a32ccabe4a7..00d92c873bd 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -1485,7 +1485,10 @@ bool InstCombiner::transformConstExprCastCall(CallSite CS) { // // into: // call void @takes_i32_inalloca(i32* null) - if (Callee->getAttributes().hasAttrSomewhere(Attribute::InAlloca)) + // + // Similarly, avoid folding away bitcasts of byval calls. + if (Callee->getAttributes().hasAttrSomewhere(Attribute::InAlloca) || + Callee->getAttributes().hasAttrSomewhere(Attribute::ByVal)) return false; CallSite::arg_iterator AI = CS.arg_begin(); |