Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Please make sure there is good test coverage and no compile-time problems before posting a patch for review.
llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp | ||
---|---|---|
687–710 | This can't be correct - we are replacing shl with lshr? | |
709 | This case falls through and creates a compile-time warning (when compiled by clang). |
Comment Actions
LGTM - but please add a test to verify that we do not create a bug with shl.
I think this would have miscompiled with the previous revision of the patch:
define <2 x i8> @trunc_lshr_trunc(<2 x i64> %a) { %b = trunc <2 x i64> %a to <2 x i32> %c = shl <2 x i32> %b, <i32 9, i32 7> %d = trunc <2 x i32> %c to <2 x i8> ret <2 x i8> %d }
Comment Actions
I commit it in https://reviews.llvm.org/rG793bb7049db012df4fe3ff6e8abc320677845400,and it pass after this patch.
This case falls through and creates a compile-time warning (when compiled by clang).