llvm-6502/test/CodeGen/AArch64/arm64-cast-opt.ll
David Blaikie 7c9c6ed761 [opaque pointer type] Add textual IR support for explicit type parameter to load instruction
Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

Differential Revision: http://reviews.llvm.org/D7649

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230794 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-27 21:17:42 +00:00

32 lines
1018 B
LLVM

; RUN: llc -O3 -march=arm64 -mtriple arm64-apple-ios5.0.0 < %s | FileCheck %s
; <rdar://problem/15992732>
; Zero truncation is not necessary when the values are extended properly
; already.
@block = common global i8* null, align 8
define zeroext i8 @foo(i32 %i1, i32 %i2) {
; CHECK-LABEL: foo:
; CHECK: cset
; CHECK-NOT: and
entry:
%idxprom = sext i32 %i1 to i64
%0 = load i8*, i8** @block, align 8
%arrayidx = getelementptr inbounds i8, i8* %0, i64 %idxprom
%1 = load i8, i8* %arrayidx, align 1
%idxprom1 = sext i32 %i2 to i64
%arrayidx2 = getelementptr inbounds i8, i8* %0, i64 %idxprom1
%2 = load i8, i8* %arrayidx2, align 1
%cmp = icmp eq i8 %1, %2
br i1 %cmp, label %return, label %if.then
if.then: ; preds = %entry
%cmp7 = icmp ugt i8 %1, %2
%conv9 = zext i1 %cmp7 to i8
br label %return
return: ; preds = %entry, %if.then
%retval.0 = phi i8 [ %conv9, %if.then ], [ 1, %entry ]
ret i8 %retval.0
}