mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
Add a totally synthetic situation I came up with while looking at a bug in
related code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65437 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
74c80df2b8
commit
20babb112c
@ -1690,6 +1690,7 @@ For example: store of float into { {{}}, float } could be turned into a store to
|
||||
the float directly.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
#include <math.h>
|
||||
double foo(double a) { return sin(a); }
|
||||
|
||||
@ -1704,3 +1705,19 @@ vs:
|
||||
foo:
|
||||
jmp sin
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
Instcombine should replace the load with a constant in:
|
||||
|
||||
static const char x[4] = {'a', 'b', 'c', 'd'};
|
||||
|
||||
unsigned int y(void) {
|
||||
return *(unsigned int *)x;
|
||||
}
|
||||
|
||||
It currently only does this transformation when the size of the constant
|
||||
is the same as the size of the integer (so, try x[5]) and the last byte
|
||||
is a null (making it a C string). There's no need for these restrictions.
|
||||
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user