diff options
| author | Daniel Neilson <dneilson@azul.com> | 2018-01-12 21:33:37 +0000 |
|---|---|---|
| committer | Daniel Neilson <dneilson@azul.com> | 2018-01-12 21:33:37 +0000 |
| commit | 2409d2420156d34036c9d5e710cf790cee1746d9 (patch) | |
| tree | 1747420bd1676e20ea3231ad85e759284438c944 /llvm/lib/IR | |
| parent | 44dfa1de3b79335ae59df168b9bf9775cdb35c99 (diff) | |
| download | bcm5719-llvm-2409d2420156d34036c9d5e710cf790cee1746d9.tar.gz bcm5719-llvm-2409d2420156d34036c9d5e710cf790cee1746d9.zip | |
[NFC] Change MemIntrinsicInst::setAlignment() to take an unsigned instead of a Constant
Summary:
In preparation for https://reviews.llvm.org/D41675 this NFC changes this
prototype of MemIntrinsicInst::setAlignment() to accept an unsigned instead
of a Constant.
llvm-svn: 322403
Diffstat (limited to 'llvm/lib/IR')
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 1a964dfb731..42fec7e3d98 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -4048,9 +4048,13 @@ void Verifier::visitIntrinsicCallSite(Intrinsic::ID ID, CallSite CS) { Assert(AlignCI, "alignment argument of memory intrinsics must be a constant int", CS); - const APInt &AlignVal = AlignCI->getValue(); - Assert(AlignCI->isZero() || AlignVal.isPowerOf2(), - "alignment argument of memory intrinsics must be a power of 2", CS); + const auto *MI = cast<MemIntrinsic>(CS.getInstruction()); + auto IsValidAlignment = [&](unsigned Alignment) -> bool { + return Alignment == 0 || isPowerOf2_32(Alignment); + }; + Assert(IsValidAlignment(MI->getAlignment()), + "alignment argument of memory intrinsics must be 0 or a power of 2", + CS); Assert(isa<ConstantInt>(CS.getArgOperand(4)), "isvolatile argument of memory intrinsics must be a constant int", CS); |

