llvm-project
93fccabb - [CodeGenPrepare] Drop poison-generating flags on extensions in optimizeExtUses (#234134)

Commit
27 days ago
[CodeGenPrepare] Drop poison-generating flags on extensions in optimizeExtUses (#234134) `optimizeExtUses` rewrites uses of an extension's source in other blocks to read `trunc` of the extension, which is only correct where the extension isn't `poison`. A `zext nneg` can be valid only where it was originally used, like behind a check that its source isn't negative. If that check is one of the rewritten uses, it ends up reading `poison`, and on `x86_64-pc-windows-msvc`, InstSimplify in WinEHPrepare's cleanup folds it to true and causes a miscompile. Drop the extension's poison-generating flags once a use has been rewritten, like #72103 and #90382 did for similar cases in `CodeGenPrepare`. Fixes #234098.
Author
Parents
Loading