Daniel Thornburgh 05dd3ae10c
[SimplifyLibCalls] Prevent orphaned global string literals (#189502)
When `printf` is simplified to `puts`, `SimplifyLibCalls` would eagerly
create a global string for the argument before checking if `puts` is
emittable. If `puts` is not emittable (e.g. because it's an unextracted
bitcode libfunc), the optimization aborts, leaving an orphaned global
string in the module. Under expensive checks, this triggers a fatal
error because the function pass modified the module without reporting
it.

This change defers the creation of the global string until after
checking if `puts` is emittable.

(This PR was created with the help of Gemini CLI.)
2026-03-31 12:12:15 -07:00
..

This directory contains test cases for the instcombine transformation.  The
dated tests are actual bug tests, whereas the named tests are used to test
for features that the this pass should be capable of performing.