[PATCH][AArch64] Fix bug around passing VPR stack parameters
Tim Northover
t.p.northover at gmail.com
Thu May 29 23:54:54 PDT 2014
Hi Jiangning,
> Currently AAPCS64 random test is broken for VPR stack parameters, so this
> small patch is to fix it.
I wondered why this code looked so familiar. It's because I introduced
the bug a few days ago, so thanks for looking at it!
Anyway, I don't think this is the right fix. Your change means that
the ExtLoad can never actually do any extending, which means things
will go badly when the switch cases above trigger. It's slightly
worrying that these cases don't show up in the existing regression
tests; I think I'll add some.
The path you're actually coming through here is that LocInfo is
CCValAssign::BCvt, so you should probably check that and perform the
bitcast in the switch just above (like in the register case). Then the
existing code should create a NON_EXTLOAD without difficulty.
Cheers.
Tim.
P.S.
Actually, I think this area needs more work. I don't think the switch
above ever triggers at the moment, but it really should because
generic code in SelectionDAGBuilder.cpp asserts that
LowerFormalArguments returns the type it's expecting. If you run "llc
-debug" on this file:
define i8 @foo([8 x i64], i8 %stack) {
ret i8 %stack
}
We get an assertion failure with both current code and any version
that fixes your problem. I think it's harmless, as far as any
assertion failure is, but we're breaking a contract.
More information about the llvm-commits
mailing list