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

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 17:03:16 PDT 2019


craig.topper marked an inline comment as done.
craig.topper added inline comments.


================
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
----------------
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.


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

https://reviews.llvm.org/D59522





More information about the llvm-commits mailing list