[PATCH] D107692: [DAGCombine] Prevent the transform of combine for multi-use operand
Allen zhong via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 16 06:26:38 PDT 2021
Allen added a comment.
In D107692#2946669 <https://reviews.llvm.org/D107692#2946669>, @lebedev.ri wrote:
> Please,
>
> 1. either add a comment explaining why the one-use check needed
> 2. or rewrite the transform the right way, so that the lack of one-use check shows up as extra instruction bloat and not a miscompilation
ok, I'll add a comment as compare between current change and rewritting the transform , current change has more effective code (less inst) .
the following code is with rewritting the transform in your comment.
adrp x8, :got:g
ldr x8, [x8, :got_lo12:g]
mov w9, #50
mov w10, #65535
ldrh w8, [x8]
eor w9, w8, w9
add w9, w9, w10
sub w8, w8, #1
and w0, w8, w9, lsr #16
ret
================
Comment at: llvm/test/CodeGen/AArch64/arm64-srl-and.ll:7
+ at g = dso_local local_unnamed_addr global i16 0, align 4
+define dso_local noundef i32 @srl_and() local_unnamed_addr {
+; CHECK-LABEL: srl_and:
----------------
RKSimon wrote:
> do you need all the dso_local/noundef/local_unnamed_addr attributes?
yes, they are not essential, and i'll delete them later
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107692/new/
https://reviews.llvm.org/D107692
More information about the llvm-commits
mailing list