1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00
llvm-mirror/test/CodeGen/AArch64/branch-folder-merge-mmos.ll
Matt Arsenault cc12b285b6 CodeGen: Print/parse LLTs in MachineMemOperands
This will currently accept the old number of bytes syntax, and convert
it to a scalar. This should be removed in the near future (I think I
converted all of the tests already, but likely missed a few).

Not sure what the exact syntax and policy should be. We can continue
printing the number of bytes for non-generic instructions to avoid
test churn and only allow non-scalar types for generic instructions.

This will currently print the LLT in parentheses, but accept parsing
the existing integers and implicitly converting to scalar. The
parentheses are a bit ugly, but the parser logic seems unable to deal
without either parentheses or some keyword to indicate the start of a
type.
2021-06-30 16:54:13 -04:00

34 lines
1.3 KiB
LLVM

; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -stop-after branch-folder | FileCheck %s
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
; Function Attrs: norecurse nounwind
define void @foo(i32 %a, i32 %b, float* nocapture %foo_arr) #0 {
; CHECK: (load (s32) from %ir.arrayidx1.{{i[1-2]}})
entry:
%cmp = icmp sgt i32 %a, 0
br i1 %cmp, label %if.then, label %if.end
if.then: ; preds = %entry
%0 = load float, float* %foo_arr, align 4
%arrayidx1.i1 = getelementptr inbounds float, float* %foo_arr, i64 1
%1 = load float, float* %arrayidx1.i1, align 4
%sub.i = fsub float %0, %1
store float %sub.i, float* %foo_arr, align 4
br label %if.end3
if.end: ; preds = %entry
%cmp1 = icmp sgt i32 %b, 0
br i1 %cmp1, label %if.then2, label %if.end3
if.then2: ; preds = %if.end
%2 = load float, float* %foo_arr, align 4
%arrayidx1.i2 = getelementptr inbounds float, float* %foo_arr, i64 1
%3 = load float, float* %arrayidx1.i2, align 4
%sub.i3 = fsub float %2, %3
store float %sub.i3, float* %foo_arr, align 4
br label %if.end3
if.end3: ; preds = %if.then2, %if.end, %if.then
ret void
}