apint-not.ll 914 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. ; This test makes sure that the xor instructions are properly eliminated
  2. ; when arbitrary precision integers are used.
  3. ; RUN: opt < %s -instcombine -S | not grep xor
  4. define i33 @test1(i33 %A) {
  5. %B = xor i33 %A, -1
  6. %C = xor i33 %B, -1
  7. ret i33 %C
  8. }
  9. define i1 @test2(i52 %A, i52 %B) {
  10. %cond = icmp ule i52 %A, %B ; Can change into uge
  11. %Ret = xor i1 %cond, true
  12. ret i1 %Ret
  13. }
  14. ; Test that demorgans law can be instcombined
  15. define i47 @test3(i47 %A, i47 %B) {
  16. %a = xor i47 %A, -1
  17. %b = xor i47 %B, -1
  18. %c = and i47 %a, %b
  19. %d = xor i47 %c, -1
  20. ret i47 %d
  21. }
  22. ; Test that demorgens law can work with constants
  23. define i61 @test4(i61 %A, i61 %B) {
  24. %a = xor i61 %A, -1
  25. %c = and i61 %a, 5 ; 5 = ~c2
  26. %d = xor i61 %c, -1
  27. ret i61 %d
  28. }
  29. ; test the mirror of demorgans law...
  30. define i71 @test5(i71 %A, i71 %B) {
  31. %a = xor i71 %A, -1
  32. %b = xor i71 %B, -1
  33. %c = or i71 %a, %b
  34. %d = xor i71 %c, -1
  35. ret i71 %d
  36. }