[PATCH] D91338: [X86] Zero-extend pointers to i64 for x86_64

Harald van Dijk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 07:57:44 PST 2020


hvdijk added inline comments.


================
Comment at: llvm/test/CodeGen/X86/x32-function_pointer-2.ll:17
 ; CHECK: mov{{l|q}}	%{{e|r}}si, %{{e|r}}[[REG:.*]]{{d?}}
-; CHECK: callq	*%r[[REG]]
+; CHECK: callq	*%r
   tail call void %foo(i8* %h) nounwind
----------------
pengfei wrote:
> hvdijk wrote:
> > pengfei wrote:
> > > This file should not be affected, right?
> > This file is affected because `callq` can take either the copy of `*%rsi` like it did before, or `*%rsi` directly since it knows it is already zero-extended.
> I see. But this test should also pass without the patch since you just loosen check conditions.
> I think it's better to make the conditions more strict. Or at least `[[REG:.*]]` in line 16 is not needed.
Since both `%rsi` and `%r[[REG]]` are equally valid, without any reason why LLVM should prefer one over the other, I did not want to have a check that only permitted one of them since later changes to LLVM could arbitrarily change it; ideally, the check would be for `*%r{si|[[REG]]}`, but I think FileCheck does not support that. So out of those options, I would say remove the `[[REG:.*]]`; I have updated the patch to do that.


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

https://reviews.llvm.org/D91338



More information about the llvm-commits mailing list