[llvm] r209618 - [AArch64] Add a regression test for the load store optimizer.
Tilmann Scheller
t.scheller at samsung.com
Mon May 26 02:37:20 PDT 2014
Author: tilmann
Date: Mon May 26 04:37:19 2014
New Revision: 209618
URL: http://llvm.org/viewvc/llvm-project?rev=209618&view=rev
Log:
[AArch64] Add a regression test for the load store optimizer.
We have a couple of regression tests for load/store pairing, but (to my knowledge) there are no regression tests for the load/store + add/sub folding.
As a first step towards increased test coverage of this area, this commit adds a test for one instance of a load + add to pre-indexed load transformation.
Added:
llvm/trunk/test/CodeGen/AArch64/ldst-opt.ll
Added: llvm/trunk/test/CodeGen/AArch64/ldst-opt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/ldst-opt.ll?rev=209618&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/ldst-opt.ll (added)
+++ llvm/trunk/test/CodeGen/AArch64/ldst-opt.ll Mon May 26 04:37:19 2014
@@ -0,0 +1,31 @@
+; RUN: llc -mtriple=aarch64-linux-gnu -verify-machineinstrs -o - %s | FileCheck %s
+
+; This file contains tests for the AArch64 load/store optimizer.
+
+%struct.A = type { %struct.B, %struct.C }
+%struct.B = type { i8*, i8*, i8*, i8* }
+%struct.C = type { i32, i32 }
+
+; Check the following transform:
+;
+; ldr w1, [x0, #32]
+; ...
+; add x0, x0, #32
+; ->
+; ldr w1, [x0, #32]!
+
+define void @foo(%struct.A* %ptr) nounwind {
+; CHECK-LABEL: foo
+; CHECK: ldr w{{[0-9]+}}, [x{{[0-9]+}}, #32]!
+entry:
+ %a = getelementptr inbounds %struct.A* %ptr, i64 0, i32 1, i32 0
+ %add = load i32* %a, align 4
+ br label %bar
+bar:
+ %c = getelementptr inbounds %struct.A* %ptr, i64 0, i32 1
+ tail call void @bar(%struct.C* %c, i32 %add)
+ ret void
+}
+
+declare void @bar(%struct.C*, i32)
+
More information about the llvm-commits
mailing list