[llvm] r256205 - [cfi] Fix LowerBitSets on 32-bit targets.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 22 08:50:37 PST 2015
Instead of adding a new test you could adapt
test/Transforms/LowerBitSets/function.ll to also test the 32-bit case.
Peter
On Mon, Dec 21, 2015 at 10:14:05PM -0000, Evgeniy Stepanov via llvm-commits wrote:
> Author: eugenis
> Date: Mon Dec 21 16:14:04 2015
> New Revision: 256205
>
> URL: http://llvm.org/viewvc/llvm-project?rev=256205&view=rev
> Log:
> [cfi] Fix LowerBitSets on 32-bit targets.
>
> This code attempts to truncate IntPtrTy to i32, which may be the same
> type.
>
> Added:
> llvm/trunk/test/Transforms/LowerBitSets/pr25902.ll
> Modified:
> llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
>
> Modified: llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp?rev=256205&r1=256204&r2=256205&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp (original)
> +++ llvm/trunk/lib/Transforms/IPO/LowerBitSets.cpp Mon Dec 21 16:14:04 2015
> @@ -683,7 +683,7 @@ Constant *LowerBitSets::createJumpTableE
> ConstantInt *DispOffset =
> ConstantInt::get(IntPtrTy, Distance * kX86JumpTableEntrySize + 5);
> Constant *OffsetedDisp = ConstantExpr::getSub(Disp, DispOffset);
> - OffsetedDisp = ConstantExpr::getTrunc(OffsetedDisp, Int32Ty);
> + OffsetedDisp = ConstantExpr::getTruncOrBitCast(OffsetedDisp, Int32Ty);
>
> ConstantInt *Int3 = ConstantInt::get(Int8Ty, kInt3Code);
>
>
> Added: llvm/trunk/test/Transforms/LowerBitSets/pr25902.ll
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/LowerBitSets/pr25902.ll?rev=256205&view=auto
> ==============================================================================
> --- llvm/trunk/test/Transforms/LowerBitSets/pr25902.ll (added)
> +++ llvm/trunk/test/Transforms/LowerBitSets/pr25902.ll Mon Dec 21 16:14:04 2015
> @@ -0,0 +1,21 @@
> +; PR25902: gold plugin crash.
> +; RUN: opt -mtriple=i686-pc -S -lowerbitsets < %s
> +
> +define void @f(void ()* %p) {
> +entry:
> + %a = bitcast void ()* %p to i8*, !nosanitize !1
> + %b = call i1 @llvm.bitset.test(i8* %a, metadata !"_ZTSFvvE"), !nosanitize !1
> + ret void
> +}
> +
> +define void @g() {
> +entry:
> + ret void
> +}
> +
> +declare i1 @llvm.bitset.test(i8*, metadata)
> +
> +!llvm.bitsets = !{!0}
> +
> +!0 = !{!"_ZTSFvvE", void ()* @g, i64 0}
> +!1 = !{}
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
--
Peter
More information about the llvm-commits
mailing list