[llvm] 42a761e - [NewGVN][NFC] add poison tests

Nuno Lopes via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 30 02:04:30 PST 2022


Author: Nuno Lopes
Date: 2022-01-30T10:04:00Z
New Revision: 42a761e57ca2e925936c6a2ae8036f4c5f3bd08c

URL: https://github.com/llvm/llvm-project/commit/42a761e57ca2e925936c6a2ae8036f4c5f3bd08c
DIFF: https://github.com/llvm/llvm-project/commit/42a761e57ca2e925936c6a2ae8036f4c5f3bd08c.diff

LOG: [NewGVN][NFC] add poison tests

Added: 
    

Modified: 
    llvm/test/Transforms/NewGVN/basic.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/NewGVN/basic.ll b/llvm/test/Transforms/NewGVN/basic.ll
index 5601474964b60..fb167ebd0fac5 100644
--- a/llvm/test/Transforms/NewGVN/basic.ll
+++ b/llvm/test/Transforms/NewGVN/basic.ll
@@ -41,3 +41,29 @@ define i8 @simplify_add_poison(i8 %x) {
   %r = add i8 poison, %x
   ret i8 %r
 }
+
+define i8 @simplify_xor_poison(i8 %x) {
+; CHECK-LABEL: @simplify_xor_poison(
+; CHECK-NEXT:    [[R:%.*]] = xor i8 poison, [[X:%.*]]
+; CHECK-NEXT:    ret i8 [[R]]
+;
+  %r = xor i8 poison, %x
+  ret i8 %r
+}
+
+define i8 @simplify_sdiv_poison(i8 %x) {
+; CHECK-LABEL: @simplify_sdiv_poison(
+; CHECK-NEXT:    ret i8 poison
+;
+  %r = sdiv i8 poison, %x
+  ret i8 %r
+}
+
+define i8 @simplify_urem_poison(i8 %x) {
+; CHECK-LABEL: @simplify_urem_poison(
+; CHECK-NEXT:    [[R:%.*]] = urem i8 [[X:%.*]], poison
+; CHECK-NEXT:    ret i8 [[R]]
+;
+  %r = urem i8 %x, poison
+  ret i8 %r
+}


        


More information about the llvm-commits mailing list