[all-commits] [llvm/llvm-project] 10aa7e: [CodeGenPrepare] Freeze condition when transformin...

Juneyoung Lee via All-commits all-commits at lists.llvm.org
Sat Mar 14 19:10:52 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 10aa7ea951e22dbd7f2ebdeb6410cfbc8a251eb1
      https://github.com/llvm/llvm-project/commit/10aa7ea951e22dbd7f2ebdeb6410cfbc8a251eb1
  Author: Juneyoung Lee <aqjune at gmail.com>
  Date:   2020-03-15 (Sun, 15 Mar 2020)

  Changed paths:
    M llvm/lib/CodeGen/CodeGenPrepare.cpp
    M llvm/test/CodeGen/ARM/2012-08-30-select.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/optimizeSelect-DT.ll
    M llvm/test/Transforms/CodeGenPrepare/X86/select.ll

  Log Message:
  -----------
  [CodeGenPrepare] Freeze condition when transforming select to br

Summary:
This is a simple fix for CodeGenPrepare that freezes branch condition when transforming select to branch.
If it is not freezed, instsimplify or the later pipeline can potentially exploit undefined behavior.

The diff shows optimized form becase D75859 and D76048 already made a few changes to CodeGenPrepare for optimizing freeze(cmp).

Reviewers: jdoerfert, spatel, lebedev.ri, efriedma

Reviewed By: lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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




More information about the All-commits mailing list