[llvm-commits] [llvm] r141607 - /llvm/trunk/test/CodeGen/ARM/thumb2-it-block.ll
Ana Pazos
apazos at codeaurora.org
Mon Oct 10 19:37:26 PDT 2011
Bill,
So the ABS optimization exposed an issue in the if-conversion pass for Thumb
mode.
I think your regression test can be further simplified. Just the back to
back abs part is needed and some final instruction that uses the abs values
(like return the addition of the abs values).
define i32 @test(i32 %a, i32 %b) {
%cmp1 = icmp slt i32 %a, 0
%sub1 = sub nsw i32 0, %a
%abs1 = select i1 %cmp1, i32 %sub1, i32 %a
%cmp2 = icmp slt i32 %b, 0
%sub2 = sub nsw i32 0, %b
%abs2 = select i1 %cmp2, i32 %sub2, i32 %b
%add = add nsw i32 %abs1, %abs2
ret i32 %add
Shouldn't it be a test to be run for Thumb mode no matter -mtriple
specified?
I mean, run 'llc -march=thumb' turning on the if-converter pass.
I tried running 'llc -O3 -march=thumb' but it does not include if-converter
on ARM.
Is there a way to invoke llc and tell it to run the if-converter pass?
Thanks,
Ana.
-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu
[mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Bill Wendling
Sent: Monday, October 10, 2011 5:27 PM
To: llvm-commits at cs.uiuc.edu
Subject: [llvm-commits] [llvm] r141607 -
/llvm/trunk/test/CodeGen/ARM/thumb2-it-block.ll
Author: void
Date: Mon Oct 10 19:26:57 2011
New Revision: 141607
URL: http://llvm.org/viewvc/llvm-project?rev=141607&view=rev
Log:
Add testcase for PR11107.
Added:
llvm/trunk/test/CodeGen/ARM/thumb2-it-block.ll
Added: llvm/trunk/test/CodeGen/ARM/thumb2-it-block.ll
URL:
http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/thumb2-it-bl
ock.ll?rev=141607&view=auto
============================================================================
==
--- llvm/trunk/test/CodeGen/ARM/thumb2-it-block.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/thumb2-it-block.ll Mon Oct 10 19:26:57 2011
@@ -0,0 +1,49 @@
+; RUN: llc < %s -mtriple thumbv7-apple-ios5.0.0 | FileCheck %s
+; PR11107
+
+%struct.huffcodetab = type { i32, i32, i32*, i8* }
+
+ at ht = external global [34 x %struct.huffcodetab]
+
+define i32 @func(i32 %table_select, i32 %x, i32 %y, i32* %code) nounwind {
+entry:
+; CHECK: BB#0:
+; CHECK: movs.w
+; CHECK-NEXT: it mi
+; CHECK-NEXT: rsbmi
+; CHECK-NEXT: movs.w
+; CHECK-NEXT: it mi
+; CHECK-NEXT: rsbmi
+ %cmp.i = icmp sgt i32 %x, 0
+ %mul.i = sub i32 0, %x
+ %mul.i6 = select i1 %cmp.i, i32 %x, i32 %mul.i
+ %tmp = select i1 %cmp.i, i32 0, i32 1
+ %cmp.i1 = icmp sgt i32 %y, 0
+ %mul.i3 = sub i32 0, %y
+ %mul.i38 = select i1 %cmp.i1, i32 %y, i32 %mul.i3
+ br label %if.then3
+
+if.then3: ; preds = %if.end
+ %xlen = getelementptr inbounds [34 x %struct.huffcodetab]* @ht, i32 0,
i32 %table_select, i32 0
+ %tmp2 = load i32* %xlen, align 4, !tbaa !0
+ %sub = add nsw i32 %mul.i6, -15
+ %cmp4 = icmp sgt i32 %mul.i6, 14
+ %mul.i7 = select i1 %cmp4, i32 15, i32 %mul.i6
+ %sub9 = add nsw i32 %mul.i38, -15
+ %cmp7 = icmp sgt i32 %mul.i38, 14
+ %mul.i39 = select i1 %cmp7, i32 15, i32 %mul.i38
+ %mul = shl nsw i32 %mul.i7, 4
+ %add = add nsw i32 %mul, %mul.i39
+ %table = getelementptr inbounds [34 x %struct.huffcodetab]* @ht, i32 0,
i32 %table_select, i32 2
+ %tmp3 = load i32** %table, align 4, !tbaa !3
+ %arrayidx11 = getelementptr inbounds i32* %tmp3, i32 %add
+ %tmp4 = load i32* %arrayidx11, align 4, !tbaa !4
+ store i32 %tmp4, i32* %code, align 4, !tbaa !0
+ ret i32 42
+}
+
+!0 = metadata !{metadata !"int", metadata !1}
+!1 = metadata !{metadata !"omnipotent char", metadata !2}
+!2 = metadata !{metadata !"Simple C/C++ TBAA", null}
+!3 = metadata !{metadata !"any pointer", metadata !1}
+!4 = metadata !{metadata !"long", metadata !1}
_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list