apint-basictest4.ll 621 B

12345678910111213141516171819202122232425
  1. ; This is a basic sanity check for constant propagation. It tests the basic
  2. ; logic operations.
  3. ; RUN: opt < %s -sccp -S | not grep and
  4. ; RUN: opt < %s -sccp -S | not grep trunc
  5. ; RUN: opt < %s -sccp -S | grep "ret i100 -1"
  6. define i100 @test(i133 %A) {
  7. %B = and i133 0, %A
  8. %C = icmp sgt i133 %B, 0
  9. br i1 %C, label %BB1, label %BB2
  10. BB1:
  11. %t3 = xor i133 %B, -1
  12. %t4 = trunc i133 %t3 to i100
  13. br label %BB3
  14. BB2:
  15. %f1 = or i133 -1, %A
  16. %f2 = lshr i133 %f1, 33
  17. %f3 = trunc i133 %f2 to i100
  18. br label %BB3
  19. BB3:
  20. %Ret = phi i100 [%t4, %BB1], [%f3, %BB2]
  21. ret i100 %Ret
  22. }