aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorDiana Picus <Diana-Magda.Picus@amd.com>2023-01-04 11:58:58 +0100
committerDiana Picus <Diana-Magda.Picus@amd.com>2023-01-05 10:15:31 +0100
commit6ee4f253b2c4b5f86bf69936c704e8537ecc921e (patch)
treea8639af332c1629337f30e5ee555a92165356c08 /llvm/lib
parent22924bd48dcea4ba23caccedbb366fd2b4e66e30 (diff)
downloadllvm-6ee4f253b2c4b5f86bf69936c704e8537ecc921e.zip
llvm-6ee4f253b2c4b5f86bf69936c704e8537ecc921e.tar.gz
llvm-6ee4f253b2c4b5f86bf69936c704e8537ecc921e.tar.bz2
[GlobalISel] Add G_BUILD_VECTOR[_TRUNC] to CSE
Add G_BUILD_VECTOR and G_BUILD_VECTOR_TRUNC to the list of opcodes in `shouldCSEOpc`. This simplifies the code generated for vector splats. Differential Revision: https://reviews.llvm.org/D140965
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp b/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp
index 4257fc6..c821ad3 100644
--- a/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/CSEInfo.cpp
@@ -62,6 +62,8 @@ bool CSEConfigFull::shouldCSEOpc(unsigned Opc) {
case TargetOpcode::G_PTR_ADD:
case TargetOpcode::G_EXTRACT:
case TargetOpcode::G_SELECT:
+ case TargetOpcode::G_BUILD_VECTOR:
+ case TargetOpcode::G_BUILD_VECTOR_TRUNC:
return true;
}
return false;