mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 10:42:39 +01:00
[SILoadStoreOptimizer] Use std::abs to avoid truncation.
Using regular abs() causes the following warning error: absolute value function 'abs' given an argument of type 'int64_t' (aka 'long') but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value] (uint32_t)abs(Dist) > MaxDist) { ^ lib/Target/AMDGPU/SILoadStoreOptimizer.cpp:1369:19: note: use function 'std::abs' instead which causes a bot to fail: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/18284/steps/bootstrap%20clang/logs/stdio llvm-svn: 349224
This commit is contained in:
parent
08bdd31e0d
commit
eebabb0665
@ -1366,8 +1366,8 @@ bool SILoadStoreOptimizer::promoteConstantOffsetToImm(
|
||||
AM.HasBaseReg = true;
|
||||
AM.BaseOffs = Dist;
|
||||
if (TLI->isLegalGlobalAddressingMode(AM) &&
|
||||
(uint32_t)abs(Dist) > MaxDist) {
|
||||
MaxDist = abs(Dist);
|
||||
(uint32_t)std::abs(Dist) > MaxDist) {
|
||||
MaxDist = std::abs(Dist);
|
||||
|
||||
AnchorAddr = MAddrNext;
|
||||
AnchorInst = &MINext;
|
||||
|
Loading…
Reference in New Issue
Block a user