1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/CodeGen/ARM/2012-08-30-select.ll
Juneyoung Lee 3cd755e246 [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 frozen, 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
2020-03-16 12:46:20 +09:00

17 lines
385 B
LLVM

; RUN: llc < %s -mtriple=thumbv7-apple-ios | FileCheck %s
; rdar://12201387
;CHECK-LABEL: select_s_v_v:
;CHECK: vmov.i32
;CHECK: vmov
;CHECK-NEXT: vmov
;CHECK: bx
define <16 x i8> @select_s_v_v(<16 x i8> %vec, i32 %avail) {
entry:
%and = and i32 %avail, 1
%tobool = icmp eq i32 %and, 0
%ret = select i1 %tobool, <16 x i8> %vec, <16 x i8> zeroinitializer
ret <16 x i8> %ret
}