[PATCH] InstCombine: allow converting varargs calls to non-varargs.

Will Dietz via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 09:00:50 PST 2016


Patch attached.

This helps cleanup code like this:

declare i32 @test17x(i32)
define i32 @test17(i32 %arg) {
entry:
  %call = call i32 (...) bitcast (i32 (i32)* @test17x to i32 (...)*)(i32
%arg)
  ret i32 %call
}

by simplifying into:

define i32 @test17(i32 %arg) {
entry:
  %call = call i32 @test17x(i32 %arg)
  ret i32 %call
}

If this is not something InstCombine should do (ABI concerns perhaps?),
I suggest we add a testcase like the one included to verify and document
this behavior.

Thanks!

~Will
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/7de5e029/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-InstCombine-allow-converting-varargs-calls-to-non-va.patch
Type: application/octet-stream
Size: 2148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160310/7de5e029/attachment.obj>


More information about the llvm-commits mailing list