diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2016-07-30 13:25:37 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2016-07-30 13:25:37 +0000 |
| commit | afff73cb5aae41b42bb1dc8949fa21e9838e7a92 (patch) | |
| tree | 502e12895342777075350c904d099d527f876d3b /llvm | |
| parent | 96cb6bfa274e1284ad3c17d2b0adfcbba5234d3d (diff) | |
| download | bcm5719-llvm-afff73cb5aae41b42bb1dc8949fa21e9838e7a92.tar.gz bcm5719-llvm-afff73cb5aae41b42bb1dc8949fa21e9838e7a92.zip | |
[Hexagon] Perform bit arithmetic on unsigned to avoid accidentally shifting negative values.
Found by ubsan.
llvm-svn: 277268
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp index c043f5bcd1c..8a2444a255f 100644 --- a/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp +++ b/llvm/lib/Target/Hexagon/HexagonConstPropagation.cpp @@ -2047,8 +2047,8 @@ bool HexagonConstEvaluator::evaluate(const MachineInstr &MI, case Hexagon::A2_combineii: // combine(#s8Ext, #s8) case Hexagon::A4_combineii: // combine(#s8, #u6Ext) { - int64_t Hi = MI.getOperand(1).getImm(); - int64_t Lo = MI.getOperand(2).getImm(); + uint64_t Hi = MI.getOperand(1).getImm(); + uint64_t Lo = MI.getOperand(2).getImm(); uint64_t Res = (Hi << 32) | (Lo & 0xFFFFFFFF); IntegerType *Ty = Type::getInt64Ty(CX); const ConstantInt *CI = ConstantInt::get(Ty, Res, false); |

