[llvm] [NVPTX] Implement isTruncateFree and isZExtFree for i32/i64 Optimizations (PR #114683)
Justin Fargnoli via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 4 10:46:38 PST 2024
================
@@ -0,0 +1,17 @@
+; RUN: llc -march=nvptx64 < %s | FileCheck %s
+
----------------
justinfargnoli wrote:
This test looks like it's checking that the correct PTX is generated for `trunc` and `zext`. This is of course nice to have, but not what we need for this PR.
The purpose of the test associated with this PR should be to ensure that your implementation of `isTruncateFree()` has an impact. Thus, the test should fail without your change and pass with it.
I like to find a place where `isTruncateFree(EVT, EVT)` is used in a simple peephole and check against that. For example, you could piggyback off of [this peephole](https://github.com/llvm/llvm-project/blob/002a0a27bc4702d6f34434c1838cb1698a0b0098/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp#L15397-L15409) (Added and tested in 3332b70627e25c8933527e2d0dcb2ddaa7bd6b82).
https://github.com/llvm/llvm-project/pull/114683
More information about the llvm-commits
mailing list