You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the stupid contrived testcase below, sdisel is breaking every critical edge from the switch to the
blahaha block, creating a ton of duplicated code and making switch lowering uglier than it should be.
void foo(int C) {
const char *s = "blah";
switch (C) {
case 1 ... 10:
s = "bonk";
goto blahaha;
}
s = "bork";
if (C & 123) s = "perfwap";
This patch adds the minimal support for array cookies needed to enable
ClangIR generation for an array new expression that requires cookies but
does not require an explicit initializer.
This only provides the cookie support for the base Itanium CXXABI.
Different cookie calculations are required for AppleARM64, which will be
added in a subsequent patch.
Extended Description
In the stupid contrived testcase below, sdisel is breaking every critical edge from the switch to the
blahaha block, creating a ton of duplicated code and making switch lowering uglier than it should be.
void foo(int C) {
const char *s = "blah";
switch (C) {
case 1 ... 10:
s = "bonk";
goto blahaha;
}
s = "bork";
if (C & 123) s = "perfwap";
blahaha:
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
printf(s);
}
We end up with code like this:
LBB1_1: #entry.blahaha_crit_edge9
movl $_str1, %esi
jmp LBB1_14 #blahaha
LBB1_2: #entry.blahaha_crit_edge8
movl $_str1, %esi
jmp LBB1_14 #blahaha
LBB1_3: #entry.blahaha_crit_edge7
movl $_str1, %esi
jmp LBB1_14 #blahaha
LBB1_4: #entry.blahaha_crit_edge6
movl $_str1, %esi
jmp LBB1_14 #blahaha
LBB1_5: #entry.blahaha_crit_edge5
movl $_str1, %esi
jmp LBB1_14 #blahaha
...
When splitting critical edges into a block, SDIsel should factor all edges from a particular BB into a
single split block.
-Chris
The text was updated successfully, but these errors were encountered: