Skip to content

Commit e07f4d4

Browse files
committed
Disable UseAggressiveReg2MemForCodeSize on WASM
It causes an LLVM WASM backend instruction selection failure. rdar://139541259
1 parent 5bd4113 commit e07f4d4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Frontend/CompilerInvocation.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3786,6 +3786,11 @@ bool CompilerInvocation::parseArgs(
37863786
OPT_disable_aggressive_reg2mem,
37873787
SILOpts.UseAggressiveReg2MemForCodeSize);
37883788

3789+
// We ran into a LLVM backed instruction selection failure.
3790+
// This is a workaround.
3791+
if (LangOpts.Target.isWasm())
3792+
SILOpts.UseAggressiveReg2MemForCodeSize = false;
3793+
37893794
// With Swift 6, enable @_spiOnly by default. This also enables proper error
37903795
// reporting of ioi references from spi decls.
37913796
if (LangOpts.EffectiveLanguageVersion.isVersionAtLeast(6)) {

0 commit comments

Comments
 (0)