[PATCH] D59522: [X86] Don't avoid folding multiple use sign extended 8-bit immediate into instructions under optsize.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 08:48:29 PDT 2019


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: test/CodeGen/X86/immediate_merging64.ll:14
 ; CHECK-NEXT:    movq %rax, (%rsi)
-; CHECK-NEXT:    cmpq %rax, %rdi
+; CHECK-NEXT:    cmpq $-1, %rdi
 ; CHECK-NEXT:    sete %al
----------------
craig.topper wrote:
> This is weird. Once the compare selected. The use count on the -1 constant should have dropped and allowed it fold into the store. Unless isel selected the store before the cmp. I think this demonstrates a larger flaw in the use count check as part of instruction selection. The use count of constants can be influenced by instruction selection order.
Please can you raise a bug on this - we're collecting a lot of immediate constant bugs at the moment.......


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59522/new/

https://reviews.llvm.org/D59522





More information about the llvm-commits mailing list