Commit 94dcc1d6 authored by Nikita Popov's avatar Nikita Popov Committed by Tom Stellard
Browse files

[IndVarSimplify] Fix poison-safety when reusing instructions (#80458)

IndVars may replace an instruction with one of its operands, if they
have the same SCEV expression. However, such a replacement may be more
poisonous.

First, check whether the operand being poison implies that the
instruction is also poison, in which case the replacement is always
safe. If this fails, check whether SCEV can determine that reusing the
instruction is safe, using the same check as SCEVExpander.

Fixes https://github.com/llvm/llvm-project/issues/79861.

(cherry picked from commit 7d2b6f0b)
parent dc0ed54a
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment