diff options
| author | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-01-11 18:03:23 +0000 |
|---|---|---|
| committer | Krzysztof Parzyszek <kparzysz@codeaurora.org> | 2018-01-11 18:03:23 +0000 |
| commit | 4ef6cfff6aec7fadf1fec41597534bc283214178 (patch) | |
| tree | c08dc488f3ea0cc796942c22a819a534e728469f /llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | |
| parent | 999e6c296791cbf9b73ada4d0c8f57a9692974af (diff) | |
| download | bcm5719-llvm-4ef6cfff6aec7fadf1fec41597534bc283214178.tar.gz bcm5719-llvm-4ef6cfff6aec7fadf1fec41597534bc283214178.zip | |
[Hexagon] Cast elements to correct type when creating constant vector
llvm-svn: 322301
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonISelLowering.cpp')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonISelLowering.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp index 7ab942a7ca0..d375fb4702e 100644 --- a/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp +++ b/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp @@ -2509,9 +2509,10 @@ HexagonTargetLowering::getBuildVectorConstInts(ArrayRef<SDValue> Values, Consts[i] = ConstantInt::get(IntTy, 0); continue; } + // Make sure to always cast to IntTy. if (auto *CN = dyn_cast<ConstantSDNode>(V.getNode())) { const ConstantInt *CI = CN->getConstantIntValue(); - Consts[i] = const_cast<ConstantInt*>(CI); + Consts[i] = ConstantInt::get(IntTy, CI->getValue().getSExtValue()); } else if (auto *CN = dyn_cast<ConstantFPSDNode>(V.getNode())) { const ConstantFP *CF = CN->getConstantFPValue(); APInt A = CF->getValueAPF().bitcastToAPInt(); |

