[PATCH] D51861: [LSR] Combine unfolded offset into invariant register

Gil Rapaport via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 2 06:58:10 PDT 2018


gilr added a comment.

> I am confused. If they don't do (c) how can they fail?

The bad formula is cheap (due to the missing register) and therefore enters the solution and produces legal yet incorrect code which fails at runtime. With the fix, the correct formula doesn't make it to the solution and doesn't affect the generated code.

> Can't we extract a test from there?

Since testing for optimized or illegal code in these cases isn't an option in these cases, such a LIT could check that the incorrect code is not generated, that the incorrect formula is not generated, or that the correct formula is generated - which all seem fragile and overfitted to this specific bug, so I'm reluctant to add any of them (especially since the bug is covered by 4 runtime tests). What do you think?


https://reviews.llvm.org/D51861





More information about the llvm-commits mailing list