[PATCH] D76179: [CodeGenPrepare] Freeze condition when transforming select to br

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 10:11:22 PDT 2020


aqjune created this revision.
aqjune added reviewers: jdoerfert, spatel, lebedev.ri, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/D75859> and D76048 <https://reviews.llvm.org/D76048> already made a few changes to CodeGenPrepare for optimizing freeze(cmp).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76179

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76179.250364.patch
Type: text/x-patch
Size: 5189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200314/fa02ad84/attachment.bin>


More information about the llvm-commits mailing list