[llvm-commits] [cfe-commits] [LLVMdev] [Patch?] Fix handling of ARM homogenous aggregates

Anton Korobeynikov anton at korobeynikov.info
Tue Apr 10 13:35:55 PDT 2012


Hi Tim

> I'm not sure I follow this point. Is preserving the source language a bad
> thing for some reason I'm missing? Certainly, if it affects optimisation it
> would be.
Let's consider one example:

union {
  float foo[4];
  int bar[3];
};

This is definitely not a HFA. However, such a union can be represented
via several different things in LLVM IR: [4 x float], [4 x i32], [32 x
i8] (all involving bitcasts to access one of the fields of a union).
And here we have a problem: 4 x float can be thought as HFA at IR
level, however it's certainly not since the HFA rules are worded using
C-level constructs and not IR-level.

So, my point is that IR is not expressible enough to capture all
source information necessary to model ABI properly. Do you have good
solution for this problem?

-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-commits mailing list