[PATCH] D25847: [ValueTracking] Don't assume we can speculate shifts
Eli Friedman via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 20 16:20:15 PDT 2016
efriedma added a comment.
In LangRef "the result is undefined" essentially means "returns undef", like a load from uninitialized memory. There isn't any reason we can't speculate a shift, as long as the result isn't actually used for anything.
I would guess that we're performing a transformation which assumes that "lshr i32 1, %n" returns either 1 or 0, which isn't correct for n >= 32.
More information about the llvm-commits