[all-commits] [llvm/llvm-project] 7d2b6f: [IndVarSimplify] Fix poison-safety when reusing in...

Nikita Popov via All-commits all-commits at lists.llvm.org
Mon Feb 5 01:11:51 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d2b6f0b355bc98bbe3aa5bae83316a708da33ee
      https://github.com/llvm/llvm-project/commit/7d2b6f0b355bc98bbe3aa5bae83316a708da33ee
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2024-02-05 (Mon, 05 Feb 2024)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyIndVar.cpp
    M llvm/test/Transforms/IndVarSimplify/pr55925.ll
    M llvm/test/Transforms/IndVarSimplify/pr79861.ll

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list