[all-commits] [llvm/llvm-project] 4e1c20: [SimplifyCFG] Fix assertion failure when reusing t...

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Jan 18 00:31:09 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4e1c2077262e0e7c708da8077874c2c022a86adc
      https://github.com/llvm/llvm-project/commit/4e1c2077262e0e7c708da8077874c2c022a86adc
  Author: pvellien <pvellien at amd.com>
  Date:   2022-01-18 (Tue, 18 Jan 2022)

  Changed paths:
    M llvm/lib/Transforms/Utils/SimplifyCFG.cpp
    A llvm/test/Transforms/SimplifyCFG/X86/switch-to-lookup-globals.ll

  Log Message:
  -----------
  [SimplifyCFG] Fix assertion failure when reusing table switch comparison

After D116332, some icmps no longer fold with the target-independent
constant folder. The SimplifyCFG code assumed that the comparison
would always fold, which is not guaranteed. Explicitly check that the
result is either true or false.

Differential Revision: https://reviews.llvm.org/D117184




More information about the All-commits mailing list