Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: tests_lit/llvm2ice_tests/bool-folding.ll

Issue 1904233002: Subzero: Fix over-aggressive bool folding. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Hack for pure virtual method Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/bool-folding.ll
diff --git a/tests_lit/llvm2ice_tests/bool-folding.ll b/tests_lit/llvm2ice_tests/bool-folding.ll
index 6f87128c03fda7c6efe9a84485f927590f030733..d0fd53e3f78582adc34af713e0a54842b746ba8f 100644
--- a/tests_lit/llvm2ice_tests/bool-folding.ll
+++ b/tests_lit/llvm2ice_tests/bool-folding.ll
@@ -269,6 +269,58 @@ next:
; ARM32: movne
; ARM32: bx lr
+; Cmp/branch non-folding due to load folding and intervening store.
+define internal i32 @no_fold_cmp_br_store(i32 %arg2, i32 %argaddr) {
+entry:
+ %addr = inttoptr i32 %argaddr to i32*
+ %arg1 = load i32, i32* %addr, align 1
+ %cmp1 = icmp slt i32 %arg1, %arg2
+ store i32 1, i32* %addr, align 1
+ br i1 %cmp1, label %branch1, label %branch2
+branch1:
+ ret i32 1
+branch2:
+ ret i32 2
+}
+
+; CHECK-LABEL: no_fold_cmp_br_store
+; CHECK: cmp
+; CHECK: set
+; CHECK: cmp
+
+; Cmp/select non-folding due to load folding and intervening store.
+define internal i32 @no_fold_cmp_select_store(i32 %arg1, i32 %argaddr) {
+entry:
+ %addr = inttoptr i32 %argaddr to i32*
+ %arg2 = load i32, i32* %addr, align 1
+ %cmp1 = icmp slt i32 %arg1, %arg2
+ store i32 1, i32* %addr, align 1
+ %result = select i1 %cmp1, i32 %arg1, i32 %argaddr
+ ret i32 %result
+}
+
+; CHECK-LABEL: no_fold_cmp_select_store
+; CHECK: cmp
+; CHECK: setl
+; CHECK: mov DWORD PTR
+; CHECK: cmp
+; CHECK: cmovne
+
+; Cmp/select folding due to load folding and non-intervening store.
+define internal i32 @fold_cmp_select_store(i32 %arg1, i32 %argaddr) {
+entry:
+ %addr = inttoptr i32 %argaddr to i32*
+ %arg2 = load i32, i32* %addr, align 1
+ %cmp1 = icmp slt i32 %arg1, %arg2
+ %result = select i1 %cmp1, i32 %arg1, i32 %argaddr
+ store i32 1, i32* %addr, align 1
+ ret i32 %result
+}
+
+; CHECK-LABEL: fold_cmp_select_store
+; CHECK: cmp {{.*}},DWORD PTR
+; CHECK: cmovl
+
; Cmp/multi-select non-folding because of extra non-whitelisted uses.
define internal i32 @no_fold_cmp_select_multi_non_whitelist(i32 %arg1,
i32 %arg2) {
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698