-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Open
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillallvm:GVNGVN and NewGVN stages (Global value numbering)GVN and NewGVN stages (Global value numbering)
Description
| Bugzilla Link | 32570 |
| Version | trunk |
| OS | All |
| CC | @hfinkel |
Extended Description
E.g. in this example, GVN can't turn this into load a[100]:
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i32, i1)
define double @trivial_memcpy(<200 x double> *%a) {
%b = alloca <200 x double>
%acast = bitcast <200 x double> *%a to i8*
%bcast = bitcast <200 x double> *%b to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %bcast, i8* %acast, i64 1600, i32 8, i1 0)
%innerptr = getelementptr <200 x double>, <200 x double> *%a, i32 0, i32 100
%inner = load double, double *%innerptr
ret double %inner
}Now for this particular example, SROA does do this optimization, but this feels like something that GVN should be able to do as well.
Metadata
Metadata
Assignees
Labels
bugzillaIssues migrated from bugzillaIssues migrated from bugzillallvm:GVNGVN and NewGVN stages (Global value numbering)GVN and NewGVN stages (Global value numbering)