diff options
author | Tobias Grosser <tobias@grosser.es> | 2016-02-02 22:05:29 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2016-02-02 22:05:29 +0000 |
commit | 5d3fc1ea4342272c653c12196363c6c670f9e313 (patch) | |
tree | 942f9d9bb23a28df87c70fa6c80621348c8ebe96 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 3b50e70bbea015324d9c21cb7b01fdf6638aff3d (diff) | |
download | llvm-5d3fc1ea4342272c653c12196363c6c670f9e313.zip llvm-5d3fc1ea4342272c653c12196363c6c670f9e313.tar.gz llvm-5d3fc1ea4342272c653c12196363c6c670f9e313.tar.bz2 |
Support loads with differently sized types from a single array
We support now code such as:
void multiple_types(char *Short, char *Float, char *Double) {
for (long i = 0; i < 100; i++) {
Short[i] = *(short *)&Short[2 * i];
Float[i] = *(float *)&Float[4 * i];
Double[i] = *(double *)&Double[8 * i];
}
}
To support such code we use as element type of the modeled array the smallest
element type of all original array accesses. Accesses with larger types are
modeled as multiple accesses with the smaller type.
For example the second load access is modeled as:
{ Stmt_bb2[i0] -> MemRef_Float[o0] : 4i0 <= o0 <= 3 + 4i0 }
To support jscop-rewritable memory accesses we need each statement instance to
only be assigned a single memory location, which will be the address at which
we load the value. Currently we obtain this address by taking the lexmin of
the access function. We may consider keeping track of the memory location more
explicitly in the future.
llvm-svn: 259587
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions