[PATCH] D23296: [ValueTracking] Improve ValueTracking on left shift with nsw flag

Li Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 9 11:10:40 PDT 2016


lihuang added inline comments.

================
Comment at: test/Analysis/ValueTracking/known-signbit-shift.ll:20
@@ +19,3 @@
+  %c = or i32 %a, -2147483648
+  %d = and i32 %b, 7
+  %shift = shl nsw i32 %c, %d
----------------
sanjoy wrote:
> Why do you need to `and` with `7` here?  Why not just `shl` directly with `%b`?
It just didn't work without the "and", it seems like this optimization doesn't recognize the case when the second operand of shift is totally unknown. But this should be some other problem, not the problem with this change. I will investigate. 


https://reviews.llvm.org/D23296





More information about the llvm-commits mailing list