aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/VectorUtils.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2020-09-02 20:44:12 -0700
committerCraig Topper <craig.topper@intel.com>2020-09-02 20:44:12 -0700
commitb16e8687ab6c977ddab3409939e867828f394311 (patch)
treeff3e386b6bcf8c179cbf58c76d36156b5f9c13e2 /llvm/lib/Analysis/VectorUtils.cpp
parentca134374b74e2c2c6e96695502f3a0974c1da4c1 (diff)
downloadllvm-b16e8687ab6c977ddab3409939e867828f394311.zip
llvm-b16e8687ab6c977ddab3409939e867828f394311.tar.gz
llvm-b16e8687ab6c977ddab3409939e867828f394311.tar.bz2
[CodeGenPrepare][X86] Teach optimizeGatherScatterInst to turn a splat pointer into GEP with scalar base and 0 index
This helps SelectionDAGBuilder recognize the splat can be used as a uniform base. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D86371
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 0bc8b72..e241300 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -342,7 +342,7 @@ int llvm::getSplatIndex(ArrayRef<int> Mask) {
/// This function is not fully general. It checks only 2 cases:
/// the input value is (1) a splat constant vector or (2) a sequence
/// of instructions that broadcasts a scalar at element 0.
-const llvm::Value *llvm::getSplatValue(const Value *V) {
+Value *llvm::getSplatValue(const Value *V) {
if (isa<VectorType>(V->getType()))
if (auto *C = dyn_cast<Constant>(V))
return C->getSplatValue();