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

Joerg Sonnenberger via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 15:18:49 PST 2016


On Thu, Mar 10, 2016 at 05:00:50PM +0000, Will Dietz via llvm-commits wrote:
> 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?),

Are you sure this doesn't break e.g. x86_64 or other platforms that tag
the use of FP registers for variadic functions?

Joerg


More information about the llvm-commits mailing list